This is a migrated thread and some comments may be shown as answers.

Expand RowDetails

3 Answers 88 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 31 Mar 2014, 08:23 PM
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

3 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 03 Apr 2014, 04:59 PM
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.

 
0
Kevin
Top achievements
Rank 1
answered on 04 Apr 2014, 10:47 PM
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?
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.

 
Tags
GridView
Asked by
Kevin
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Kevin
Top achievements
Rank 1
Share this question
or