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.
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.
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?
0
Yoan
Telerik team
answered on 09 Apr 2014, 02:38 PM
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.