Telerik Forums
UI for WPF Forum
4 answers
761 views

I have a few columns in my RadGridView, which I would like to filter - but not to allow Search as You Type.

Is there  any way to do this?

 

In addition: I have boolean values, which I show as "Yes" and "No" in the grid - but in the filters, they are shown as "True" and "False". It there any way to change this to let the filter sow "Yes" and "No", too?

Best regards

Inger Marie

Inger Marie
Top achievements
Rank 1
 answered on 22 Feb 2017
9 answers
838 views

Hi,
I have a specific behavior I want to achieve with respect to the AutoCompleteBox.

Requirements:

  1. When the box is empty the pop-up must suggest all options, much like a combo-box does
  2. When the box gets focus, the pop-up must open and show the corresponding suggestions
  3. Selection must be achieved through hitting enter key or clicking an item on the pop-up

Tried solution:

  • Implement a FilteringBehavior to return all items when search text is empty

public class MyFilteringBehavior : FilteringBehavior
{
    public override IEnumerable<object> FindMatchingItems(string searchText, IList items, IEnumerable<object> escapedItems, string textSearchPath,
        TextSearchMode textSearchMode)
    {
        if (string.IsNullOrEmpty(searchText))
            return items.Cast<object>();
        return base.FindMatchingItems(searchText, items, escapedItems, textSearchPath, textSearchMode);
    }
}

  •  Upon receiving a GotFocus event perform a Populate on the auto-complete box

private void Classes_GotFocus(object sender, RoutedEventArgs e)
{
    var box = (RadAutoCompleteBox) sender;
    box.Populate(box.SearchText);
    //box.IsDropDownOpen = true; // Not necessary
}

  • Setting up the RadAutoCompleteBox on Xaml

<telerik:RadAutoCompleteBox Grid.Row="4" Grid.Column="2"
         Name="Classes"
         ItemsSource="{Binding Classes}"
         AutoCompleteMode="SuggestAppend"
         SelectionMode="Multiple"
         TextSearchMode="Contains"
         IsHighlighted="True"
         FilteringBehavior="{StaticResource MyFilteringBehavior}"
         GotFocus="Classes_GotFocus"/>

Expected behavior:

  • Requirements 1 and 2 are achieved successfully
  • With a highlighted item in the popup, hitting enter commits the selection into the box and closes the popup

Unexpected/unwanted effects:

  • While cycling focus through a series of text boxes and auto complete boxes the first option gets selected when the tab key is hit
  • Users cannot select any item while mouse-left-clicking on items in the pop-up

Is there any way to avoid the unwanted behavior while on this setup?

Nasko
Telerik team
 answered on 22 Feb 2017
3 answers
226 views

Hello,

I'd like to use a DesktopAlert in a WPF MVVM app.

I copy the code from the Telerik WPF app - DesktopAlert Examples - First Look app (email example).

Code:

public class AlertViewModel : BaseViewModel
{
private RadDesktopAlertManager desktopAlertManager;

public AlertViewModel()
{
this.desktopAlertManager = new RadDesktopAlertManager(AlertScreenPosition.BottomRight, 5d);
}

public Action ActivateMainWindowAction { get; set; }
private void OnAlertCommandExecuted(object param)
{            
if (this.ActivateMainWindowAction != null)
{
this.ActivateMainWindowAction.Invoke();
}            
}

public void TestAlert()
{
BitmapImage b = new BitmapImage();
b.BeginInit();
b.UriSource = new Uri("C:\\...\\error.png");
b.EndInit();

this.desktopAlertManager.ShowAlert(new DesktopAlertParameters
{
Header = "Header",
Content = "Content",
Icon = new Image { Source = b, Width = 48, Height = 48 },
IconColumnWidth = 48,
IconMargin = new Thickness(10, 0, 20, 0),
Command = new DelegateCommand(this.OnAlertCommandExecuted),
CommandParameter = "ABC"
});
}
}

public partial class Alert : UserControl
{
public Alert()
{
InitializeComponent();
AlertViewModel vm = ServiceLocator.Current.GetInstance<AlertViewModel>();
vm.ActivateMainWindowAction = new Action(this.ActivateMainWindow);
DataContext = vm;
}

private void ActivateMainWindow()
{
var mainWindow = Application.Current.MainWindow;

if (mainWindow != null)
{
if (mainWindow.WindowState == WindowState.Minimized)
{
mainWindow.WindowState = WindowState.Normal;
}

if (!mainWindow.IsActive)
{
mainWindow.Activate();
}
}
}
}

 

The DesktopAlertParameters command never execute and the alert never show.

Is there something i miss? If i try desktop alert on a new classic WPF app (no mvvm) works withuot problems.

 

Thanks.

 

Nasko
Telerik team
 answered on 22 Feb 2017
4 answers
121 views
Hi,

Is the number of slices in a radial menu configurable?

Sebastien
Dhaval
Top achievements
Rank 1
 answered on 22 Feb 2017
1 answer
105 views

Hi,

Any update on removing the white space from the menu if we are using less then 8 items?
Because it is looking very bad on the UI section.

Our clients want to remove the white space. So any option to do it?

Waiting for your quick reply.

Kalin
Telerik team
 answered on 22 Feb 2017
3 answers
264 views
I've put a RadMaskedNumericInput control onto window. To that I wanted to add validation. Here's the custom class I came up with:

public class ByteValidation : ValidationRule
{
    private byte min = 0;
    private byte max = byte.MaxValue;
 
    //The Minimum and Maximum values are there to restrict how low and how high the
    //stored value can be.
    public byte Minimum
    {
        get { return min; }
        set { min = value; }
    }
 
    public byte Maximum
    {
        get { return max; }
        set { max = value; }
    }
 
    public string ErrorMessage
    { get; set; }
 
    public override ValidationResult Validate(object value, System.Globalization.CultureInfo cultureInfo)
    {
        if (value == null)
        {
            return new ValidationResult(true, null);
        }
 
        byte tmp;
 
        try
        {
            double dTmp = (double)value;
            tmp = (byte)dTmp;
        }
        catch (Exception)
        {
            return new ValidationResult(false, "Invalid value");
        }
 
        if (tmp < min || tmp > max)
        {
            return new ValidationResult(false, ErrorMessage);
        }
 
        return new ValidationResult(true, null);
    }
}

and here's the XAML:

<telerik:RadMaskedNumericInput Mask="##" Margin="550,0,0,0" Grid.Row="1" FontSize="16" VerticalAlignment="Bottom" FontFamily="Century Gothic">
    <telerik:RadMaskedNumericInput.Value>
        <Binding Path="DaysPaidLast30">
            <Binding.ValidationRules>
                <local:ByteValidation Minimum="0" Maximum="30" ErrorMessage="Value must be between 0 and 30." />
            </Binding.ValidationRules>
        </Binding>
    </telerik:RadMaskedNumericInput.Value>
</telerik:RadMaskedNumericInput>

This all works fine.

In testing I discovered that if I put in some invalid numeric data, then I'll get a gold border and a popup message. Is that color standard with the RadMaskedNumericInput? Can that be styled?

xxx
Evgenia
Telerik team
 answered on 21 Feb 2017
1 answer
152 views

When I view the RadGridView, I can hide columns using the IsVissible=false method.  This appears to be ignored when printing.  Is this true and if so, is there another way that I can dynamically cause columns to not be printed?

If all the columns show, it bleeds to a second page and if I force all columns to print on a single page, the font is simply too small to read.

Thanks.

Dilyan Traykov
Telerik team
 answered on 21 Feb 2017
17 answers
688 views

I'm trying to add a tooltiptemplate for the series in my RadCartesianChart. I can't get this to work but I don't see any problem with it.

XAML:

<telerik:ScatterLineSeries x:Key="ToolTipDisplay2">
<telerik:ScatterLineSeries.PointTemplate>
<DataTemplate>
<Ellipse Width="2" Height="2" Fill="Black" />
</DataTemplate>
</telerik:ScatterLineSeries.PointTemplate>
</telerik:ScatterLineSeries>

 

C# code:

... series added...

ScatterLineSeries temp1 = (ScatterLineSeries) this.Resources["ToolTipDisplay2"];
survivalChart.Series[survivalChart.Series.Count() - 1].TooltipTemplate = (DataTemplate) temp1.TooltipTemplate;

 

William
Top achievements
Rank 1
 answered on 21 Feb 2017
2 answers
1.4K+ views

Hi Guys,

I'm struggling with an issue and I can't figure why this goes wrong.

I cannot access my object in the resourcedictionary in my code behind.  What I have is the following
I have a resourcedictionary like this.

 

                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                    xmlns:telerikScheduleView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.ScheduleView"
                    xmlns:telerikColorPickers="clr-namespace:Telerik.Windows.Controls.RichTextBoxUI.ColorPickers;assembly=Telerik.Windows.Controls.RichTextBoxUI"
                    xmlns:local="clr-namespace:Proj"
                    xmlns:p="clr-namespace:Proj.Resources"
                    x:Class="Proj.ProductieOrderViewRecources">
 
 
    <DataTemplate x:Key="ProductieOrderViewToolBarTemplate">
        <telerik:RadRichTextBoxRibbonUI x:Name="richTextBoxRibbonUI"

 

this whitin this resourcedictionary
I have a radgridview like this.

<DataTemplate x:Key="ProductieOrderViewMainSectorTemplate">
    <Grid Margin="10">
        <Grid>
            <telerik:RadBusyIndicator x:Name="BusyIndicator" Grid.Row="2" Visibility="{Binding ShowPlanning}" >
                <telerik:RadGridView x:Name="gridViewAdminData"
                                     ItemsSource="{Binding DataRecords}"
                                     RowEditEnded="EditRecord"
                                     DataLoading="LoadData"
                                     SelectionChanged="GridSelectionChanged"
                                     FrozenColumnCount ="5"
                                     AutoGenerateColumns="False"
                                     Deleting="RadGridView_deleting"
                                     SelectedItem="{Binding SelectedPlanning}">
                    <telerik:RadGridView.Columns>
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding Artikel}" IsReadOnly="True" />
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding Aantal}" />

now I'm trying the access the gridViewAdminData by name in the code behind.

but it won't work at all.
I have this in my code

public partial class ProductieOrderViewRecources : ResourceDictionary
{
    public ProductieOrderViewRecources()
    {
        InitializeComponent();
         
            System.Linq.Expressions.Expression<Func<Proj.Models.productieorder, double>> expression = order => (order.AantalTeProduceren + 10);
            //RadGridView gridViewAdminData = (RadGridView)this["gridViewAdminData"];
            GridViewExpressionColumn column = gridViewAdminData.Columns["TotalValue"] as GridViewExpressionColumn;
            column.Expression = expression;
         
    }
}

but gridViewAdminData won't get recognized. Also enabling the line above gives back a null value.

Does anyone have any idea about how to access this object in the code behind?

thank you

Bart
Top achievements
Rank 1
 answered on 21 Feb 2017
6 answers
86 views

Hello,

I have a VisualizationLayer bound to a collection of objects. I've defined a MapEllipseView for (some of) the objects in the collection via an ItemTemplateSelector.
The issue I have is that when I add items to the collection the ellipses are only rendered on the map at the completion of a zoom animation.

How can I get them to appear straight away after they are added in the collection?

Thanks,
Chris

Petar Mladenov
Telerik team
 answered on 21 Feb 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?