Bind RadGridView.GroupHeaderTemplate for WPF

6 posts, 0 answers
  1. Ajay
    Ajay avatar
    6 posts
    Member since:
    Apr 2018

    Posted 25 Apr Link to this post

    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

  2. Stefan
    Admin
    Stefan avatar
    1044 posts

    Posted 30 Apr Link to this post

    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.
  3. Ajay
    Ajay avatar
    6 posts
    Member since:
    Apr 2018

    Posted 01 May Link to this post

    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

  4. Ajay
    Ajay avatar
    6 posts
    Member since:
    Apr 2018

    Posted 01 May in reply to Ajay Link to this post

    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

  5. Stefan
    Admin
    Stefan avatar
    1044 posts

    Posted 04 May Link to this post

    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.
  6. Ajay
    Ajay avatar
    6 posts
    Member since:
    May 2018

    Posted 19 Jul in reply to Stefan Link to this post

    Hi,
    The issue is resolved. I have used binding as -   Text="{Binding  Group.Items[0].TestObject.FieldName}". 
    Thanks,
    Ajay
Back to Top