Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
50
Add a button in header or group header to make some action on group of data displated in Datagrid under the group
posted

is it possible to simply add a button in the header or group header to make some action on group of data displated in Datagrid under the group ?

Parents
No Data
Reply
  • 29630
    Offline posted

    Hello Stephane,

    In order to achieve your requirement, I have a couple of recommendations in this case. First, the elements you are looking for in this case are the LabelPresenter and the GroupByRecordPresenter for the regular XamDataGrid Field headers and the group-by headers, respectively.

    If you write a Style for LabelPresenter (which exists in the same xmlns namespace as XamDataGrid), the LabelPresenter has a ContentTemplate property that you can set to a new DataTemplate and place your Button inside. This will make a Button appear in the header of your Fields. Each Field also has a LabelPresenterStyle property that you can apply your style to individually if you would like.

    The GroupByRecordPresenter does not have this ContentTemplate, and so if you want to modify it, I would make the recommendation of inclusion of the default style for GroupByRecordPresenter and modifying that. You can also do this with the LabelPresenter. The default style for GroupByRecordPresenter and LabelPresenter exists in the DataPresenterGeneric_Express.xaml file commonly found at the following directory with Infragistics controls installed:

    C:\Program Files (x86)\Infragistics\<version>\WPF\DefaultStyles\DataPresenter

    Please let me know if you have any other questions or concerns on this matter.

Children