Override RadGridView Row Style while keeping the existing content

1 Answer 27 Views
GridView
Ohad
Top achievements
Rank 3
Bronze
Iron
Iron
Ohad asked on 14 Jun 2022, 02:13 PM

I have a RadGridView that I want to keep its structure but add some button of my own at the end of each line.

<telerik:RadGridView Grid.Row="0" 
                     ItemsSource="{Binding MyList}"
                     RowIndicatorVisibility="Collapsed"
                     AutoGenerateColumns="False"
                     FrozenColumnsSplitterVisibility="Collapsed">
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding A}" Header="A"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding B}" Header="B"/>
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

 

And for example, I want to achieve that:

 

 

I would be happy for help with how I can do this

1 Answer, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 16 Jun 2022, 02:28 PM

Hello Ohad,

To achieve the desired result, you need to extract and modify the control template of the GridViewRow element. You can add an extra ColumnDefinition to the SelectiveScrollingGrid of the row and place the button in it. You will also need to modify the ColumnSpan of some of the comprising elements, however, such as the SelectionBackground, for example.

For your convenience, I've prepared a small sample project demonstrating how you can achieve this in the Expression Dark theme. If you're using another theme, however, you'd need to modify the template accordingly.

Nonetheless, I hope you find this helpful.

Regards,
Dilyan Traykov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
GridView
Asked by
Ohad
Top achievements
Rank 3
Bronze
Iron
Iron
Answers by
Dilyan Traykov
Telerik team
Share this question
or