This question is locked. New answers and comments are not allowed.
I was wondering if it was possible to use rowdetailstemplate with a custom layout in radgridview for silverlight. I had a project where the rowdetailstemplate worked fine without the custom template on the main grid. I have tried adding a radgridtogglebutton to the custom layout, as well as changing rowdetailsvisibility to Visible. I am using row details template because I make a separate call to a web service for each level of the hierarchy, and I am trying to do as much in possible in code to keep the silverlight control as general a possible.
The user control is below:.
<UserControl x:Class="listo.SLGrid.GridControl" xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input" xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input" xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" xmlns:telerikGridView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" xmlns:local="clr-namespace:listo.SLGrid" Loaded="UserControl_Loaded"> <Canvas x:Name="LayoutRoot" Background="LightCoral" HorizontalAlignment="Stretch" > <StackPanel x:Name="gridStack" > <telerikGridView:RadGridView x:Name="crmDataGrid" IsFilteringAllowed="False" ShowInsertRow="True" AddingNewDataItem="crmDataGrid_AddingNewDataItem" BeginningEdit="crmDataGrid_BeginningEdit" RowEditEnded="crmDataGrid_RowEditEnded" ScrollViewer.VerticalScrollBarVisibility="Auto" Grid.Row="1" Grid.Column="0" RowDetailsVisibilityMode="Visible" LoadingRowDetails="crmDataGrid_RowDetailsVisibilityChanged" ActionOnLostFocus="None" > </telerikGridView:RadGridView> </StackPanel> </Canvas> <!--RowStyleSelector="{StaticResource styleSelector}" RowDetailsVisibilityMode="Collapsed"--></UserControl>The test template is simple, and works, except that my rowdetails are not accessible:
<Application.Resources> <ResourceDictionaryxmlns:telerikRow="http://schemas.telerik.com/2008/xaml/presentation"xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"xmlns:telerikGridView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" > <ControlTemplate x:Key="new_questionid" TargetType="telerikRow:GridViewRow" > <Grid> <Grid.RowDefinitions > <RowDefinition /> <RowDefinition /> <RowDefinition /> <RowDefinition /> <RowDefinition /> <RowDefinition /> <RowDefinition /> </Grid.RowDefinitions> <Grid.ColumnDefinitions > <ColumnDefinition Width="20" /> <ColumnDefinition Width="*"/> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <TextBox Grid.Column="1" Grid.Row="0" Text="Name" /> <telerikRow:GridViewToggleButton Name="RowDetailsToggle" Grid.Column="0" Grid.Row="0" Grid.RowSpan="7" ></telerikRow:GridViewToggleButton> </Grid> </ControlTemplate> <Style x:Key="style_new_questionid" TargetType="telerikRow:GridViewRow"> <Setter Property="Template" Value="{StaticResource new_questionid}" /> </Style> </ResourceDictionary> </Application.Resources>I set rowdetails in code, the template is passed in parameters, but I could include in my resource dictionary if that would work better:
_crmGrid.RowDetailsTemplate = CreateRowDetailsTemplate(HttpUtility.UrlDecode(this.parameters[srpCrmSLGridParameters.rowDetailsTemplate])); I was hoping that you could point me to an example where a custom layout was used along with row details. Ideally I would like to set both in code. Second choice would be to read them from a resource dictionary. Is this possible?
Thank you,
Jennifer