Align child columns with header column

1 Answer 37 Views
GridView
Jarne
Top achievements
Rank 2
Iron
Jarne asked on 16 Oct 2024, 12:32 PM

I have a grid with header and child rows. Some columns are the same in the child rows but not everything.

How can I align the columns properly that the header and the child are below each other?

vb: colum1 column2 column3 column4

    column1                 column3

Like in the screenshot. I have to align the yellow, blue and red columns. But the other columns don't have to be visible in the child. 

 

1 Answer, 1 is accepted

Sort by
1
Accepted
Nadya | Tech Support Engineer
Telerik team
answered on 17 Oct 2024, 02:13 PM

Hello, Jarne,

To achieve your goal, it is necessary to set Width, MaxWidth and MinWidth of the certain hierarchy level in form's constructor and thus, adjust the column's width from the master template with those from the second template. It is up to you to consider the exact width of each other and place them in such a way to appear one above the other.

For example:

    grid.MasterTemplate.Columns["Name"].Width = 150;
    grid.MasterTemplate.Columns["Name"].MaxWidth = 150;
    grid.MasterTemplate.Columns["Name"].MinWidth = 150;
 
    grid.Templates[0].Columns["Name"].Width = 131;
    grid.Templates[0].Columns["Name"].MaxWidth = 131;
    grid.Templates[0].Columns["Name"].MinWidth = 131;

 

I hope this information is useful. If you have other questions, please let me know. 

Regards,
Nadya | Tech Support Engineer
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
GridView
Asked by
Jarne
Top achievements
Rank 2
Iron
Answers by
Nadya | Tech Support Engineer
Telerik team
Share this question
or