Telerik Forums
UI for WPF Forum
3 answers
80 views

Hi All,

I want to customize the ErrorToolTip property of RadDatePicker Control.

I am able to do with event ParseDateTimeValue of RadDatePicker Control based on some condition.

           if (Convert.ToDateTime(input) < dateLimit)
            {
                (sender as RadDatePicker).ErrorTooltipContent = "Another Error";
                args.IsParsingSuccessful = false;
                args.Result = args.PreviousValue;
            }

its working fine when I am typing some date manually but when I am selecting the date from RadDatePicker Control ,the same code executes but ErrorToolTip is not displaying

Please help me.

Priyatam
Top achievements
Rank 1
 answered on 22 Oct 2018
1 answer
136 views

 In high DPI screen,many software's cursor is too small,include the telerik UI,but besides the microsoft.
I got the following code to resolve the problem,you can try:

static ConstructorInfo _cursorScaleStreamCtor= typeof(Cursor).GetConstructor(new Type[2]
   {
    typeof(Stream),
    typeof(bool)
   });
   //uri refer to the *.cur file(normal 32x32),compile for resource
   internal static Cursor LoadCursor(Uri uri)
        {
            StreamResourceInfo resourceStream = Application.GetResourceStream(uri);
            if ( _cursorScaleStreamCtor != null)
            {
                return (Cursor)_cursorScaleStreamCtor.Invoke(new object[2]
                {
                    resourceStream.Stream,
                    true
                });
            }
            return new Cursor(resourceStream.Stream);
        }


Martin Ivanov
Telerik team
 answered on 22 Oct 2018
5 answers
522 views

I like the new Glyph-feature and use it in my recent project. Unfortunately the Glyph-Icons are not visible during design time in VS 2013, I can only see an empty rectangle. What do I have to do so these icons are also visible during design?

Regards
Heiko

Martin Ivanov
Telerik team
 answered on 22 Oct 2018
0 answers
84 views

Hi

 

The zero data caused NAN case.

Please check the data of the attached file.

Is there any way to remove NAN?

 

My code.

dataprovider.AggregateDescriptions.Add(new PropertyAggregateDescription()

{

PropertyName = "AAA",

AggregateFunction = AggregateFunctions.Sum,

TotalFormat = new PercentOfColumnTotal()

});

준완
Top achievements
Rank 1
 asked on 22 Oct 2018
1 answer
57 views

     Chart.Series.Add(new LineSeries
     {
      CategoryBinding = binding,
      ValueBinding = ...,
      StrokeThickness = 1,
      Stroke = ...,
      ItemsSource = vm.Datas,
      TrackBallInfoTemplate = // difficult to create
     });

 

TrackBallInfoTemplate is difficult to create, how can i only set a stringformat to use trackballinfo

Si
Top achievements
Rank 1
 answered on 20 Oct 2018
4 answers
470 views

An earlier post explains how to set IsUndoEnabled=false to prevent RadNumericUpDown from handling undo. I did that, and it disabled the local undo feature. However, when focus is on the control and I press Ctrl-Z or Ctrl-Y, my global commands are not executed, although they work when focus is not on the RadNumericUpDown.

 

I tried two approaches to resolve this: adding a KeyDown handler, and adding local input bindings. The KeyDown handler receives the LControl key, but not the Z or Y keys while LControl is pressed. The local input bindings don't seem to do anything (see below).

So, after setting IsUndoEnabled=false, how do I get Ctrl-Z and Ctrl-Y to execute my global commands when focus is on the RadNumericUpDown control?

 

 

  <telerik:RadNumericUpDown   VerticalAlignment="Center"
         NumberDecimalDigits="2"
         Margin="0"
         Width="80"
         Loaded="RadNumericUpDown_Loaded"
         Value="{Binding Width}">
   <telerik:RadNumericUpDown.InputBindings>
    <KeyBinding Gesture="Ctrl+Z" Command="{Binding UndoCommand}" />
    <KeyBinding Gesture="Ctrl+Y" Command="{Binding RedoCommand}" />
   </telerik:RadNumericUpDown.InputBindings>
  </telerik:RadNumericUpDown>

 

 

Georg
Top achievements
Rank 1
Veteran
 answered on 19 Oct 2018
3 answers
265 views

Hello!

How can I dynamically customize RibbonView quick access toolbar? I want to show and hide buttons using quick access toolbar menu like in Microsoft Office applications. It seems that this is not possible and menu is not customizable either.

Thank you.

 

Dilyan Traykov
Telerik team
 answered on 19 Oct 2018
1 answer
241 views

I am making a test app to measure the loading speed of Windows DataGrid vs RadGrid. In the app I was binding Data Tables and Collections into DataGrid and RadGrid. Binding to the Windows DataGrid I would see and average time of 5ms for DataTables and 1.5ms for Collections. When you bind to RadGrid I get 200-400ms regardless of the type. Any ideas?

<telerik:RadBusyIndicator IsBusy="{Binding Path=IsBusy}">
        <Grid DataContext="{Binding Telerik, Source={StaticResource Locator}}">

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.Resources>
                <Style TargetType="DataGrid">
                    <Setter Property="HorizontalAlignment" Value="Stretch"/>
                    <Setter Property="VerticalAlignment" Value="Stretch"/>
                    <Setter Property="Margin" Value="10"/>
                </Style>
                <Style TargetType="Button">
                    <Setter Property="Width" Value="75"/>
                    <Setter Property="HorizontalAlignment" Value="Center"/>
                    <Setter Property="VerticalAlignment" Value="Center"/>
                    <Setter Property="Margin" Value="10"/>
                </Style>
                <Style TargetType="TextBlock">
                    <Setter Property="Width" Value="75"/>
                    <Setter Property="HorizontalAlignment" Value="Center"/>
                    <Setter Property="VerticalAlignment" Value="Center"/>
                    <Setter Property="Margin" Value="10"/>
                </Style>
                <Style x:Key="TextLabel" TargetType="TextBlock">
                    <Setter Property="HorizontalAlignment" Value="Right"/>
                    <Setter Property="VerticalAlignment" Value="Center"/>
                    <Setter Property="Margin" Value="2"/>
                    <Setter Property="FontWeight" Value="Bold"/>
                </Style>
                <Style x:Key="ToolBarImage" TargetType="Image">
                    <Setter Property="Width" Value="20"/>
                    <Setter Property="Height" Value="20"/>
                    <Setter Property="Margin" Value="1"/>
                </Style>
            </Grid.Resources>
            <ToolBarTray>
                <ToolBar>
                    <Button Command="{Binding ExitCommand}"  ToolTip="Home">
                        <Grid>
                            <Image Source="{StaticResource Home}" Style="{StaticResource ResourceKey=ToolBarImage}"/>
                        </Grid>
                    </Button>
                    <Button Command="{Binding DataCommand}"  ToolTip="Execute" >
                        <Grid>
                            <Image Source="{StaticResource Play}" Style="{StaticResource ResourceKey=ToolBarImage}"/>
                        </Grid>
                    </Button>
                    <Button Command="{Binding ResetCommand}"  ToolTip="Reset">
                        <Grid>
                            <Image Source="{StaticResource Reset}" Style="{StaticResource ResourceKey=ToolBarImage}"/>
                        </Grid>
                    </Button>
                    <Separator/>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Execution Time:" Style="{StaticResource TextLabel}"/>
                        <TextBlock Text="{Binding TimeElapsed, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay, StringFormat={}{0:F3} ms}"/>
                    </StackPanel>
                    <Separator/>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Average Time:" Style="{StaticResource TextLabel}"/>
                        <TextBlock Text="{Binding AvgTimeElapsed, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay, StringFormat={}{0:F3} ms}"/>
                    </StackPanel>
                    <Separator/>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Times executed: " Style="{StaticResource TextLabel}"/>
                        <TextBlock Text="{Binding ExecutedNum, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/>
                    </StackPanel>
                </ToolBar>
            </ToolBarTray>
            <telerik:RadGridView Grid.Row="1" Grid.Column="0" ItemsSource="{Binding MoldData}" Name="dataGridView1"/>
            
        </Grid>
    </telerik:RadBusyIndicator>

Dilyan Traykov
Telerik team
 answered on 19 Oct 2018
10 answers
684 views
Hi,
I am using RadTreeView to display the hierarchy such as folders/subfolders and items within them. I have implemented template and style selectors according to the treeview item type But in case that I have a lot of folders (100+) with items in it (10+ items per folder) it take to much time to bind that on UI.
NOTE: folders are expanded by default.
I checked my data access layer and results are retrieved from the database in a decent time, so seems to me that the issue is just on UI side. I checked whether virtualization is working,check the live tree view and saw that there is ~20 folders loaded, even though, according to the current window(container) size there can be visible just 2 expanded folders with their items on the viewable area, so I was suspecting that this could be a cause of some delays because event virtualization is working, tree view loads much more elements than it could display.

Is there any way to handle this?

Also, whenever UI is refreshed I can see in my log exception like:
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'ListBoxItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')

I figured out that it throwing this exception takes some amount of time. I checked the styles and tried to update all suspicious places in code but still getting the same error, so maybe I do not understand the real meaning of that exception. Any thoughts on this error?
Stefan
Telerik team
 answered on 19 Oct 2018
0 answers
59 views

                    Chart.Series.Add(new LineSeries
                    {
                        CategoryBinding = binding,
                        ValueBinding = ...,
                        StrokeThickness = 1,
                        Stroke = ...,
                        ItemsSource = vm.Datas,
                        TrackBallInfoTemplate = // difficult to create
                    }); 

 

TrackBallInfoTemplate is difficult to create, how can i only set a stringformat to use trackballinfo

Si
Top achievements
Rank 1
 asked on 19 Oct 2018
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?