Telerik Forums
UI for WPF Forum
1 answer
1.6K+ views
If I type a letter it goes to the event, but not the arrow keys.

KeyUp does catch the arrow keys, so that's what I'm going to use


I'm basically doing this to put things in edit mode on the arrow up and arrow down:
private void handleArrows(object sender, KeyEventArgs e)
{
    RadGridView rgv = (RadGridView)sender;
    if (e.Key == Key.Down)
    {
        RadGridViewCommands.MoveDown.Execute(null);
        rgv.BeginEdit();
        e.Handled = true;
    }
    if (e.Key == Key.Up)
    {
         RadGridViewCommands.MoveUp.Execute(null);
        rgv.BeginEdit();
        e.Handled = true;
    }
}
Yoan
Telerik team
 answered on 28 Mar 2014
3 answers
119 views
Hello,
I'm using MVVM pattern and a behavior to load hierarchical data from a radgridview... at the main row expansion I call a webservice to fetch data, after some operation I need to reload the inner gridview..... I don't know how to clean the content just loaded since if I do a

  parentGrid.IsExpanded = false;
  parentGrid.IsExpanded = true;

it doesn't make the call since it has the data already loaded...
Thanks in advance

Paolo
Dimitrina
Telerik team
 answered on 28 Mar 2014
11 answers
336 views
Hi,

I am using RadDateTimePicker control for my WPF app.

On clicking the calendar icon next to the data text box, the calendar shows up and I can select a date.
But when I hit next/previous to change month, the Calendar disappears and even after hitting the little calendar icon, the calendar doesn't show up ever again.

Here's the code that is being used on my WPF screen:

<telerik:RadDateTimePicker x:Name="editableStartDate" Width="100" Margin="0,1" IsTooltipEnabled="False" InputMode="DatePicker" SelectedValue="{Binding StartDate, Mode=TwoWay}" HorizontalAlignment="Left" VerticalAlignment="Top" Height="26" Grid.Row="2" Grid.Column="1" />

Am I doing something wrong here ? Please let me know.

thx,
Ashish


Hassan
Top achievements
Rank 1
 answered on 28 Mar 2014
4 answers
380 views
I have RadCartisianChart on a Window and on a button click I would like to add a vertical line at a particular channel (x-axis value) and label the line.  Here is the code for my button click event.

Please let me know if you know why the CartsianCustomAnnotation is now being displayed.  I've also provided a link to a zipped stripped-down example C# WPF project which demonstrates this: Telerik ChartView CartesianCusomAnnotation not display

01.private void Button_OnClick(object sender, RoutedEventArgs e)
02.    {
03.      Random rnd = new Random();
04.      int curChannel = rnd.Next(1, 1000);
05. 
06.      CartesianGridLineAnnotation myLineAnnotation = new CartesianGridLineAnnotation();
07.      myLineAnnotation.Axis = radCartesianChart1.HorizontalAxis;
08.      myLineAnnotation.Value = curChannel;
09.      
10.      myLineAnnotation.Stroke = System.Windows.Media.Brushes.Fuchsia;
11.      radCartesianChart1.Annotations.Add(myLineAnnotation);
12. 
13.      var newKLMLabel = new CartesianCustomAnnotation();
14.      newKLMLabel.HorizontalAxis = radCartesianChart1.HorizontalAxis;
15.      newKLMLabel.VerticalAxis = radCartesianChart1.VerticalAxis;
16. 
17.      var border = new Border();
18.      border.CornerRadius = new CornerRadius(4);
19.      border.Background = Brushes.Gray;
20.      border.Opacity = 0.9;
21. 
22.      //var content = new TextBlock();
23.      var content = new Label();
24.      content.Content = "Channel " + curChannel.ToString();
25.      border.Child = content;
26. 
27.      newKLMLabel.Content = border;
28.      newKLMLabel.HorizontalValue = curChannel;
29.      newKLMLabel.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
30.      newKLMLabel.VerticalValue = _chartVM.ParticleEdsSpectrum[curChannel].Counts;
31.       
32.      newKLMLabel.Tag = "klmlabel";
33. 
34.      newKLMLabel.Visibility = Visibility.Visible;
35. 
36.      radCartesianChart1.Annotations.Add(newKLMLabel);
37. 
38.    }
David
Top achievements
Rank 1
 answered on 27 Mar 2014
2 answers
498 views
Just start working with RadGridView and faced this issue in Design time, in runtime everything is working fine. For example this simple scenario from documentation.

All other control work fine both in design time and runtime.
I'm using Visual studio 2012 Update 3. Telerik 2013.2.611.45.Trial

<UserControl xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"  x:Class="MyAppNameHere.Desktop.View.UsersControl"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:viewModel="clr-namespace:Toto.Desktop.ViewModel"
             mc:Ignorable="d" d:DataContext="{d:DesignInstance Type=viewModel:UsersVm}"
             d:DesignHeight="300" d:DesignWidth="600">
 
    <Grid x:Name="LayoutRoot" Background="White">
        <telerik:RadGridView x:Name="radGridView" />
    </Grid>
</UserControl>

Error information:

System.NullReferenceException
Object reference not set to an instance of an object.
   at Microsoft.Expression.WpfPlatform.WpfPlatformMetadata.ShouldTrimSurroundingWhiteSpace(IType typeId)
   at Microsoft.Expression.Markup.XamlParser.ParseContent(XamlParserContext parserContext, IDocumentNodeReference
...............

or sometimes this error:

System.ArgumentException
Property 'System.Object ItemsSource' is not defined for type 'Telerik.Windows.Controls.RadGridView'
   at System.Linq.Expressions.Expression.Property(Expression expression, PropertyInfo property)
   at System.Linq.Expressions.Expression.Property(Expression expression, MethodInfo propertyAccessor)
   at Telerik.Windows.Controls.GridView.Design.GridViewDataControlMetadata.AddDefaultAttributes(AttributeCallbackBuilder builder)
..........


Kind regards, Denis
Brian
Top achievements
Rank 1
 answered on 27 Mar 2014
5 answers
169 views
Hello i have an interface with Raddocking component. It saves and load layout ok, load the content for each radpane after loading...

But i have a problem. The content of each pane have a UserControl with a WindowFormHost inside.  Only when radpane go to floating, the content appears in blank. I try to add the content again when the radpane go to float, but with no result.

Any ideas?

Thanks in advance.
Steve
Top achievements
Rank 1
 answered on 27 Mar 2014
9 answers
314 views
Hello!

We have an issue with databinding and raddocking mode change. 
When you switch to floating mode, the databind fails.
After you swich back to docked state/tabbed document, the databinding works again.
We experienced this issue when we had a usercontrol inside of the radpane. Also tried to manually update the datacontext at every panestatechange, but when the pane was in tabbed document mode by default, it just made it worse (it failed, and never get works again).

Here's a small code piece we used to make our proof-of-concept:

Window1.xaml
<telerikDocking:RadDocking HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" AllowUnsafeMode="True" x:Name="InfoPanel_RadDocking">
            <telerikDocking:RadDocking.DocumentHost>
                <telerikDocking:RadSplitContainer >
                    <telerikDocking:RadPaneGroup telerikDocking:ProportionalStackPanel.RelativeSize="1000,400">
                        <telerikDocking:RadPane x:Name="InfoPane" Header="Pane1" BorderThickness="0" >
                            <TelerikDockingBugPOC:DemoControl />
                        </telerikDocking:RadPane>
                        <telerikDocking:RadPane x:Name="Pane2" Header="Pane2" BorderThickness="0" IsEnabled="{Binding Path=LayoutStateHandler.IsWagnisTabEnabled, Mode=OneWay}">
                        </telerikDocking:RadPane>
                        <telerikDocking:RadPane x:Name="Pane3" Header="Pane3" BorderThickness="0">
                        </telerikDocking:RadPane>
                    </telerikDocking:RadPaneGroup>
                </telerikDocking:RadSplitContainer>
            </telerikDocking:RadDocking.DocumentHost>
        </telerikDocking:RadDocking>

The Democontrol.xaml:
<Grid Background="LightGreen">
        <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center"  Text="{Binding DemoText}" />
   </Grid>

The binding points to a dummy string property of Window1 (so it's NOT in the Democontrol.xaml.cs).

We're using the latest version of radcontrols.

Thank you for your help!

Greetings, 
Thomas
Kalin
Telerik team
 answered on 27 Mar 2014
4 answers
184 views
I am using a Unity dependency container and microsoft Prism. I am injecting views into my docking panels, and this works fine. I have a button on Pane  A that injects a new view into Pane B. Both of these panes are docked. If I undock ether of the panes and click the button in Pane A, the region manager cannot find the region anymore, and I get the following exception.

An unhandled exception of type 'System.Collections.Generic.KeyNotFoundException' occurred in Microsoft.Practices.Prism.dll
Additional information: The region manager does not contain the MapInteractionPanel region.

This is the line that causes the exception:
 IRegion region = regionManager.Regions["MapInteractionPanel"];

This works PERFECTLY fine if I leave both panes docked, so clearly the telerik docking is doing something when it undocks. Any ideas? Thanks.
None
Top achievements
Rank 1
 answered on 27 Mar 2014
4 answers
148 views
Hello!
I have Self-referenced hierachical GridView sach as:

<telerik:RadGridView RowIsExpandedChanged="RadGridView1_OnRowIsExpandedChanged" DataLoadMode="Asynchronous" AutoGenerateColumns="False" DataLoading="RadGridView1_OnDataLoading" GroupRenderMode="Flat"  ItemsSource="{Binding Path=., Mode=TwoWay}" x:Name="RadGridView1" ShowGroupPanel="False" Grid.Row="3" Grid.ColumnSpan="2">
            <telerik:RadGridView.Resources>
                <DataTemplate x:Key="CellTemplateForColorOfLinesEdit">
                    <telerik:RadColorPicker SelectedColorChanged="OnSelectedColorChanged" SelectedColor="{Binding StoreLayouts[0].ColorForLines.Color, Mode=TwoWay}"></telerik:RadColorPicker>
                </DataTemplate>
                <DataTemplate x:Key="CellTemplateForColorOfLines">
                    <Border Background="{Binding StoreLayouts[0].ColorForLines}">
                        <TextBlock></TextBlock>
                    </Border>
                </DataTemplate>
                <DataTemplate x:Key="CellTemplateForX">
                    <telerik:RadNumericUpDown ValueChanged="OnXValueChanged"  Value="{Binding StoreLayouts[0].X, Mode=TwoWay}" CustomUnit="м." NumberDecimalDigits="2" ValueFormat="Numeric" SmallChange="0.01"/>
                </DataTemplate>
                <DataTemplate x:Key="CellTemplateForY">
                    <telerik:RadNumericUpDown ValueChanged="OnYValueChanged" Value="{Binding StoreLayouts[0].Y, Mode=TwoWay}" CustomUnit="м." NumberDecimalDigits="2" ValueFormat="Numeric" SmallChange="0.01"/>
                </DataTemplate>
                <DataTemplate x:Key="CellTemplateForWidth">
                    <telerik:RadNumericUpDown ValueChanged="OnWidthChanged" Value="{Binding StoreLayouts[0].Width, Mode=TwoWay}" CustomUnit="м." NumberDecimalDigits="2" ValueFormat="Numeric" SmallChange="0.01"/>
                </DataTemplate>
                <DataTemplate x:Key="CellTemplateForHeight">
                    <telerik:RadNumericUpDown ValueChanged="OnHeightChanged" Value="{Binding StoreLayouts[0].Height, Mode=TwoWay}" CustomUnit="м." NumberDecimalDigits="2" ValueFormat="Numeric" SmallChange="0.01"/>
                </DataTemplate>
                <DataTemplate x:Key="CellTemplateForGWidth">
                    <telerik:RadNumericUpDown ValueChanged="OnGridWidthChanged" Value="{Binding StoreLayouts[0].Grid_width, Mode=TwoWay}" CustomUnit="м." NumberDecimalDigits="2" ValueFormat="Numeric" SmallChange="0.01"/>
                </DataTemplate>
                <DataTemplate x:Key="CellTemplateForGHeight">
                    <telerik:RadNumericUpDown ValueChanged="OnGridHeightChanged" Value="{Binding StoreLayouts[0].Grid_height, Mode=TwoWay}" CustomUnit="м." NumberDecimalDigits="2" ValueFormat="Numeric" SmallChange="0.01"/>
                </DataTemplate>
            </telerik:RadGridView.Resources>
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="Наименование" DataMemberBinding="{Binding Storename}"></telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Цвет линий" CellTemplate="{StaticResource CellTemplateForColorOfLines}" CellEditTemplate="{StaticResource CellTemplateForColorOfLinesEdit}" ></telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Шаг сетки по ширине" CellTemplate="{StaticResource CellTemplateForGWidth}"></telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Шаг сетки по высоте" CellTemplate="{StaticResource CellTemplateForGHeight}"></telerik:GridViewDataColumn>
            </telerik:RadGridView.Columns>
            <telerik:RadGridView.FilterDescriptors>
                <telerik:FilterDescriptor Member="Storeparentid" Operator="IsEqualTo" Value="null"></telerik:FilterDescriptor>
            </telerik:RadGridView.FilterDescriptors>
            <telerik:RadGridView.ChildTableDefinitions>
                <telerik:GridViewTableDefinition>
                    <telerik:GridViewTableDefinition.Relation>
                        <telerik:TableRelation IsSelfReference="True">
                            <telerik:TableRelation.FieldNames>
                                <telerik:FieldDescriptorNamePair
                            ParentFieldDescriptorName="Storeid"
                            ChildFieldDescriptorName="Storeparentid" />
                            </telerik:TableRelation.FieldNames>
                        </telerik:TableRelation>
                    </telerik:GridViewTableDefinition.Relation>
                </telerik:GridViewTableDefinition>
            </telerik:RadGridView.ChildTableDefinitions>
        </telerik:RadGridView>


With my data there are 5 level of nested grid. I have another tree view with this hierarchy. My goal is to synchronize opened element between this 2 control. But my nested GridView filled in code behid sach as:

 var datacontrol = (RadGridView)sender;
            if (datacontrol.ParentRow == null) return;
            datacontrol.ShowGroupPanel = false;
            datacontrol.AutoGenerateColumns = false;
            datacontrol.DataLoadMode = DataLoadMode.Asynchronous;
            var storeNameColumn = new GridViewDataColumn { DataMemberBinding = new Binding("Storename"), Header = "Наименование" };
            datacontrol.Columns.Add(storeNameColumn);
            var storeTypeName = new GridViewDataColumn { DataMemberBinding = new Binding("StoreType.StoreTypeName"), Header = "Тип" };
            datacontrol.Columns.Add(storeTypeName);
            var storeNumber = new GridViewDataColumn { DataMemberBinding = new Binding("Storenumber"), Header = "Номер" };
            datacontrol.Columns.Add(storeNumber);
            var xColumn = new GridViewDataColumn { Header = "X", CellTemplate = RadGridView1.Resources["CellTemplateForX"] as DataTemplate, UniqueName = "XCOL" };
            datacontrol.Columns.Add(xColumn);
            var yColumn = new GridViewDataColumn { Header = "Y", CellTemplate = RadGridView1.Resources["CellTemplateForY"] as DataTemplate };
            datacontrol.Columns.Add(yColumn);
            var widthColumn = new GridViewDataColumn { Header = "Ширина", CellTemplate = RadGridView1.Resources["CellTemplateForWidth"] as DataTemplate };
            datacontrol.Columns.Add(widthColumn);
            var heightColumn = new GridViewDataColumn { Header = "Высота", CellTemplate = RadGridView1.Resources["CellTemplateForHeight"] as DataTemplate };
            datacontrol.Columns.Add(heightColumn);
            var colorPickerColumn = new GridViewDataColumn
            {
                DataMemberBinding = new Binding("ColorForLines"),
                Header = "Цвет линий",
                CellTemplate = RadGridView1.Resources["CellTemplateForColorOfLines"] as DataTemplate,
                CellEditTemplate = RadGridView1.Resources["CellTemplateForColorOfLinesEdit"] as DataTemplate
            };
            datacontrol.Columns.Add(colorPickerColumn);
            var gridWidthColumn = new GridViewDataColumn { CellTemplate = RadGridView1.Resources["CellTemplateForGWidth"] as DataTemplate, Header = "Шаг сетки по ширине" };
            datacontrol.Columns.Add(gridWidthColumn);
            var gridHeightColumn = new GridViewDataColumn { CellTemplate = RadGridView1.Resources["CellTemplateForGHeight"] as DataTemplate, Header = "Шаг сетки по высоте" };
            datacontrol.Columns.Add(gridHeightColumn);

As I understand the event  DataLoading="RadGridView1_OnDataLoading" occures when row is expanded. Before that moment I can't find element in nested grid. My querstion is:
1)How to force DataLoading event for all nested grid (I want for the grid will be loaded immediately and full without rise DataLoading event)
2)How to find element in nested grid (may be on 3 or 4 level)
3)Is it possible to expand element in nested grid and recursevly expand all his parent row.
Sorry for my English. 



ilusha
Top achievements
Rank 1
 answered on 27 Mar 2014
1 answer
89 views
Hello,
when using the Office2013 theme, the TextBox and PasswordBox have not the same internal margin at the left of the text. This makes the display strange when they are displayed one below the other.
Patrick
Yordanka
Telerik team
 answered on 27 Mar 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?