This is a migrated thread and some comments may be shown as answers.

Altering Autogenerated columns properties of Detailstable

1 Answer 59 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Suresh Krishna
Top achievements
Rank 1
Suresh Krishna asked on 30 May 2018, 04:09 PM

Hi,

I have a Hierarchy Binding raggrid with details table , I would like to change the header text and width from code. I was able to do that on mastertableview but not able to reach the details table.

For Each col As GridBoundColumn In rgTestGrid.MasterTableView.AutoGeneratedColumns
 
col.HeaderStyle.Width = Unit.Pixel(65)
 
Next

Is there any way to change the column header with of details table like this?

Thanks in advance

regards

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Eyup
Telerik team
answered on 04 Jun 2018, 06:53 AM
Hi Suresh,

Here are some options to achieve this requirement:

1. If you are using auto-generated columns for the detail tables as well, then you can make avail of the OnColumnCreated event handler:
https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/columns/working-with-autogenerated-columns#customizing-auto-generated-columns

2. You can also use the DetailTableDataBind event handler of the grid which provides e.DetailTableView argument:
http://demos.telerik.com/aspnet-ajax/grid/examples/data-binding/programmatic-hierarchy/defaultcs.aspx

3. There is also the option to traverse the tables recursively, similar to the sample explained and demonstrated here:
https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/how-to/hierarchy/hiding-the-expand-collapse-images-when-no-records

I hope this will prove helpful.

Regards,
Eyup
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Suresh Krishna
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or