Altering Autogenerated columns properties of Detailstable

2 posts, 1 answers
  1. Suresh Krishna
    Suresh Krishna avatar
    30 posts
    Member since:
    Sep 2009

    Posted 30 May 2018 Link to this post

    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

     

  2. Answer
    Eyup
    Admin
    Eyup avatar
    3990 posts

    Posted 04 Jun 2018 Link to this post

    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.
Back to Top