RadGridView hierarchy force RowSourceNeeded event always

2 posts, 1 answers
  1. ahmed
    ahmed avatar
    3 posts
    Member since:
    Oct 2015

    Posted 11 Apr Link to this post

    Hello there , 

    i have RadGridView hierarchy with 3 level

    i want to do the following

    1- when expand any row at the first level , i need to collapse any other expanded row.

    2-  when expand any row at the first level i need to dispose any data source assigned to other rows , in other words i want to keep my memory to contain only the datasource of current expanded row.

    for example

    i expanded first row , then rowsourceneed event will be fired and second level will be binded

    when expand second row , also rowsourceneed event will be fired and second level will be binded 

    now i need to clear the datasource for first expanded row , and when first row expanded again it will force rowsourceneed event to be fired again

    please help me.

    regards,

    Ahmed.

  2. Answer
    Dess
    Admin
    Dess avatar
    1609 posts

    Posted 12 Apr Link to this post

    Hello Ahmed,

    Thank you for writing.

    You can use the RadGridView.ChildViewExpanded event to detect when a row is expanded. However, note that when using load on demand approach, the RowSourceNeeded event is fired once for a certain parent row and the child rows collection is internally stored in RadGridView. Expanding the same parent row for the second time won't trigger this event. This is the designed mechanism for load on demand hierarchy.

    I think that it would be more suitable to use RadVirtualGrid, where the whole data is populated by using the CellValueNeeded event. Additional information is available at the following link:
    http://docs.telerik.com/devtools/winforms/virtualgrid/hierarchical-virtual-grid/hierarchical-data

    I hope this information helps. Should you have further questions I would be glad to help.

     Regards,
    Dess
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top