Trouble with DetailsLayoutModeItemTemplate

Shell for WPF Forum

Posted 2 months ago by Brian Soltis
Version: 21.1.2
Avatar

Having trouble overriding the template for the details view for ShellListView.  I was assuming this was a template to override the whole layout, but it seems like it's only working inside the 'Name' column cells.  I'm trying to override the grid to use my own grid for custom styling so that it's consistent with the other grids in our application. 

<DataTemplate x:Key="DetailsLayoutModeTemplate">
                <telerik:RadGridView>
                    <telerik:RadGridView.Columns>
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Name" Width="Auto" MinWidth="200" />
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding Date}" Header="Date Modified" Width="Auto" MinWidth="100"  />
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding Kind}"  Header="Item Type" Width="Auto" MinWidth="75"/>
                    </telerik:RadGridView.Columns>
                </telerik:RadGridView>
            </DataTemplate>
DetailsLayoutModeItemTemplate="{StaticResource DetailsLayoutModeTemplate}"

I've also tried overriding the HeaderDetailsTemplate thinking I could style just the header to make it more consistent with our application, but it seems like it only gives control of the contents not the whole header.

 <DataTemplate x:Key="ShellHeaderTemplate">
                <TextBlock Text="{Binding Name}" TextTrimming="CharacterEllipsis" Padding="10" Margin="0" Background="White"/>
            </DataTemplate>

Link to my screenshot

Comments (1)

Posted 2 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Brian,

I'm not sure that you could just swap in another alternate grid view control in place for a row in ours.  That will likely lead to layout and input issues.  You'd probably be better off simply using their grid view and binding it to the ItemsSource of our control, if you hide ours. 

For the header, that is tricky since due to how WPF works, the header portion of the list has to be implemented in the ScrollViewer's custom template.  It will create a TreeListViewColumnHeader control for each column header and that is where the DataTemplate is applied.  You could probably make an implicit Style in your Application.Resources that targets TreeListViewColumnHeader to style each column header differently.


Actipro Software Support

The latest build of this product (v21.1.3) was released 16 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.