Hello!
Found one problem with radgridviev, which I dont know how to fix.
My scenario:
WPF app for .NET Framework 4
Windows 7 (x64) Ultimate
Version of Telerik dll's: 2011.1.419.40
Here's a structure of document that i'm querying from data source:
Client
-- Animals
----- Receptions
(there's other relations like Client - Contacts and so on...)
I show the data to user using the following hierarchy:
RadGridView (showing clients)
-- TabControl
----- RadGridView (showing animals)
---------- TabControl
--------------- RadGridView (showing receptions)
Now, for the problem:
Every RadGridView in hierarchy has handlers for: SelectionChanged, Deleted, RowEditEnded.
When i add any of SelectionChanged, Deleted, RowEditEnded handler to receptions RadGridView my app shows only the clients grid (the topmost one) with "+" that's not expandable.
Without handlers everything (in leaf RadGridView) works as expected.
If i use a debugger it shows that i have exception: NullReferenceException that's throwed from GridViewRow.OnIsExpandedChanged.
Here's a part of xaml i use :
http://pastebin.com/84hQ9rAP
Any suggestions about what am i doing wrong?
EDIT:
if i delete "RowStyleSelector="{StaticResource ReceptionRowStyleSelector}" and add handlers to my nested grid - then all seems to work again an there's no exception. But i have no row styling for grid.
That's my ReceptionRowStyleSelector code:
Styles i use a very simple:
<local:ReceptionRowStyleSelector x:Key="ReceptionRowStyleSelector">
<local:ReceptionRowStyleSelector.DefaultStyle>
<Style TargetType="telerik:GridViewRow"></Style>
</local:ReceptionRowStyleSelector.DefaultStyle>
<local:ReceptionRowStyleSelector.CompletedReception>
<Style TargetType="telerik:GridViewRow">
<Setter Property="Background" Value="#4502FF49"/>
</Style>
</local:ReceptionRowStyleSelector.CompletedReception>
<local:ReceptionRowStyleSelector.CanceledReception>
<Style TargetType="telerik:GridViewRow">
<Setter Property="Background" Value="#40000000"/>
</Style>
</local:ReceptionRowStyleSelector.CanceledReception>
<local:ReceptionRowStyleSelector.NotifiedReception>
<Style TargetType="telerik:GridViewRow">
<Setter Property="Background" Value="#4FA4B700"/>
</Style>
</local:ReceptionRowStyleSelector.NotifiedReception>
</local:ReceptionRowStyleSelector>
Thanks, Alex Yakimaskiy
Found one problem with radgridviev, which I dont know how to fix.
My scenario:
WPF app for .NET Framework 4
Windows 7 (x64) Ultimate
Version of Telerik dll's: 2011.1.419.40
Here's a structure of document that i'm querying from data source:
Client
-- Animals
----- Receptions
(there's other relations like Client - Contacts and so on...)
I show the data to user using the following hierarchy:
RadGridView (showing clients)
-- TabControl
----- RadGridView (showing animals)
---------- TabControl
--------------- RadGridView (showing receptions)
Now, for the problem:
Every RadGridView in hierarchy has handlers for: SelectionChanged, Deleted, RowEditEnded.
When i add any of SelectionChanged, Deleted, RowEditEnded handler to receptions RadGridView my app shows only the clients grid (the topmost one) with "+" that's not expandable.
Without handlers everything (in leaf RadGridView) works as expected.
If i use a debugger it shows that i have exception: NullReferenceException that's throwed from GridViewRow.OnIsExpandedChanged.
Here's a part of xaml i use :
http://pastebin.com/84hQ9rAP
Any suggestions about what am i doing wrong?
EDIT:
if i delete "RowStyleSelector="{StaticResource ReceptionRowStyleSelector}" and add handlers to my nested grid - then all seems to work again an there's no exception. But i have no row styling for grid.
That's my ReceptionRowStyleSelector code:
public
class
ReceptionRowStyleSelector : StyleSelector<br>
{
public
override
Style SelectStyle(
object
item, DependencyObject container)
{
if
(item
is
Reception)
{
var reception = (Reception)item;
if
(reception.IsCompleted)
return
CompletedReception;
if
(reception.IsCanceledByClient)
return
CanceledReception;
if
(reception.IsClientNotified)
return
NotifiedReception;
}
return
DefaultStyle;
}
...
Styles i use a very simple:
<local:ReceptionRowStyleSelector x:Key="ReceptionRowStyleSelector">
<local:ReceptionRowStyleSelector.DefaultStyle>
<Style TargetType="telerik:GridViewRow"></Style>
</local:ReceptionRowStyleSelector.DefaultStyle>
<local:ReceptionRowStyleSelector.CompletedReception>
<Style TargetType="telerik:GridViewRow">
<Setter Property="Background" Value="#4502FF49"/>
</Style>
</local:ReceptionRowStyleSelector.CompletedReception>
<local:ReceptionRowStyleSelector.CanceledReception>
<Style TargetType="telerik:GridViewRow">
<Setter Property="Background" Value="#40000000"/>
</Style>
</local:ReceptionRowStyleSelector.CanceledReception>
<local:ReceptionRowStyleSelector.NotifiedReception>
<Style TargetType="telerik:GridViewRow">
<Setter Property="Background" Value="#4FA4B700"/>
</Style>
</local:ReceptionRowStyleSelector.NotifiedReception>
</local:ReceptionRowStyleSelector>
Thanks, Alex Yakimaskiy