I have used RadGridView to show data with customize group header by GroupHeaderTemplate. I have used grouping on single column and based on that it shows the group header but not able to bind it. I had searched related to this but not found any solution. I would like to know how we bind the customized GroupHeaderTemplate from viewmodel?
I have refer below link but it not working -
http://latestupdatedinfo.blogspot.in/2016/05/telerik-wpf-radgridview-group-header.html
can you please provide sample example?
Thanks
5 Answers, 1 is accepted
Generally speaking, the DataContext of the GroupRow is the GroupViewModel and you should be able to bind to it. This is the recommended and supported mechanism for such customizations. Please, take a look at the Modify GroupRow topic for further reference.
Regards,
Stefan
Progress Telerik
Hi,
Thanks for the response.
I have attached snapshot for same.
Please find the sample source code at below link - (As I am not able to upload sample code in telerik forum)
https://www.dropbox.com/s/1tw9rlv70bgo14b/Telerik%20Example%20-%20GridHeaderTemplate.zip?dl=0
Please look into the issue and provide solutions as not able to bind through groupviewmodel.
Thanks
Hi,
Thanks for the response.
I have attached snapshot for same.
Please find the sample source code at below link - (As I am not able to upload sample code in telerik forum)
https://www.dropbox.com/s/1tw9rlv70bgo14b/Telerik%20Example%20-%20GridHeaderTemplate.zip?dl=0
Please look into the issue and provide solutions as not able to bind through groupviewmodel.
Thanks
I can confirm that by default, the DataContext of the GroupRow would be the GroupViewModel and you can bind to its properties. Since you need to specify a different binding source, I suggest you reviewing the How to: Specify the Binding Source topic.
I hope this helps.
Regards,
Stefan
Progress Telerik
The issue is resolved. I have used binding as - Text="{Binding Group.Items[0].TestObject.FieldName}".
Thanks,
Ajay