I am trying to supply different TreeListViewRow templates using a RowStyleSelector to show certain types of rows (GetMoreData rows) with a template that does not follow the columns, but instead displays a button which you click to get more data (more children for that row).
The RowStyleSelector looks like :
The MoreResults TreeListViewRow Control Template is taken from Blend "Copy Template" on the TreeListViewRow but I have simply replaced the PART_DataCellsPresenter with :
I have this basic structure working and the MoreResults rows show Buttons as expected, but there are exceptions that show up in the output window : A first chance exception of type 'System.ArgumentException' occurred in Telerik.Windows.Data.dll
Would this be the suggested approach or is there a better way, that doesn't cause the exceptions ?
The RowStyleSelector looks like :
<local:MyGridRowStyleSelector x:Key="RowStyleSelector"> <local:MyGridRowStyleSelector.MoreResultsRowStyle> <Style TargetType="telerik:TreeListViewRow" x:Name="MoreResults"> <Setter Property="telerik:TreeListViewRow.Template" Value="{StaticResource MoreDataCustomRowTemplate}" /> </Style> </local:MyGridRowStyleSelector.MoreResultsRowStyle> <local:MyGridRowStyleSelector.NormalRowStyle> <Style TargetType="telerik:TreeListViewRow" x:Name="NormalResults"> </Style> </local:MyGridRowStyleSelector.NormalRowStyle></local:MyGridRowStyleSelector>The MoreResults TreeListViewRow Control Template is taken from Blend "Copy Template" on the TreeListViewRow but I have simply replaced the PART_DataCellsPresenter with :
<ItemsControl x:Name="PART_DataCellsPresenter" Grid.ColumnSpan="2" Grid.Column="1" ItemsSource="{Binding Path=Functions}"> <ItemsControl.ItemTemplate> <DataTemplate> <Grid> <Button Content="{Binding}" /> </Grid> </DataTemplate> </ItemsControl.ItemTemplate></ItemsControl>I have this basic structure working and the MoreResults rows show Buttons as expected, but there are exceptions that show up in the output window : A first chance exception of type 'System.ArgumentException' occurred in Telerik.Windows.Data.dll
Would this be the suggested approach or is there a better way, that doesn't cause the exceptions ?