Expand RowDetails

4 posts, 0 answers
  1. Kevin
    Kevin avatar
    17 posts
    Member since:
    Feb 2011

    Posted 31 Mar 2014 Link to this post

    I'm using WPF/MVVM

    For all parent rows that have Employees.Count > 0, I need to have the row details expanded. Can you tell me how to do this. Again, I'm using MVVM and NOT using events. This needs to be done with binding.

    Thanks
  2. Yoan
    Admin
    Yoan avatar
    1215 posts

    Posted 03 Apr 2014 Link to this post

    Hi Kevin,

    You can try to expand all row details of the visible rows and update the DetailsVisibility property during the RowLoaded event. I have attached a sample project which demonstrates the approach.

    If you want to have your code-behind clean, the way to go is with an Attached behavior. Please check this MSDN article where you can find more information about it. Also you can check this article about event handling with attached behaviors. In this way you will have the code in one place only.

    Regards,
    Yoan
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. Kevin
    Kevin avatar
    17 posts
    Member since:
    Feb 2011

    Posted 04 Apr 2014 in reply to Yoan Link to this post

    You didn't ready my requirements.

    I'm using MVVM. I am NOT using events. To use events I would have to have code in the View's code behind, which I don't want to do.

    Is there no way to bind to each row's Expanded property?
  4. Yoan
    Admin
    Yoan avatar
    1215 posts

    Posted 09 Apr 2014 Link to this post

    Hello Kevin,

    I do understand your requirement - you want to have clean code behind. This is why I have suggested you to use an attached behavior. You can create such behavior as illustrated in this demo. Then you can perform the whole logic there and activate it for your RadGridView.

    Regards,
    Yoan
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top