Expand / Collapse Rows in Grid View based on Parent Child Relationship

2 posts, 1 answers
  1. Ken
    Ken avatar
    3 posts
    Member since:
    Jan 2017

    Posted 28 Jan Link to this post

    we need to expand the rows based on some condition we have(based on a flag we set). we have tried expanding the rows in both CellFormatting event and ViewCellFormatting event.but it expands only the groups which are in visible. the groups which will be pulled on scrolling the grid are not expanded. please suggest us to fix this issue as it is very high priority for us.

  2. Answer
    Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3412 posts

    Posted 29 Jan Link to this post

    Hello, Ken,      

    Note that the CellFormatting/ViewCellFormatting events are purposed to style the cells that are displayed in the grid. Due to the UI virtualization in RadGridView, cell elements are created only for currently visible cells and are being reused during operations like scrolling, filtering, grouping and so on. Hence, the CellFormatting/ViewCellFormatting events are fired only for the visible cells.

    I can suggest you to expand the desired rows after you populate the grid with data. Then, you can iterate the RadGridView.Rows collection which stores the data rows and set the IsExpanded property to the desired value.

    However, if you are still experiencing any further difficulties, it would be greatly appreciated if you can give us some more details about the exact scenario that you have and the specific requirement that you are trying to accomplish. Thus, we would get better understanding of the precise case and think about a suitable solution.

    I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top