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

Bind RadGridView.GroupHeaderTemplate for WPF

5 Answers 58 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ajay
Top achievements
Rank 1
Ajay asked on 25 Apr 2018, 10:19 AM

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

Sort by
0
Stefan
Telerik team
answered on 30 Apr 2018, 08:11 AM
Hello Ajay,

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
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Ajay
Top achievements
Rank 1
answered on 01 May 2018, 02:32 PM

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

0
Ajay
Top achievements
Rank 1
answered on 01 May 2018, 02:34 PM
[quote]Ajay said:

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

[/quote]
0
Stefan
Telerik team
answered on 04 May 2018, 10:28 AM
Hello Ajay,

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
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Ajay
Top achievements
Rank 1
answered on 19 Jul 2018, 07:28 AM
Hi,
The issue is resolved. I have used binding as -   Text="{Binding  Group.Items[0].TestObject.FieldName}". 
Thanks,
Ajay
Tags
General Discussions
Asked by
Ajay
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Ajay
Top achievements
Rank 1
Ajay
Top achievements
Rank 1
Share this question
or