Hi to All,
I would like to add one checkbox to every group header, and the handle its click or change event. In the event I must know a)what is the state of the checkbox and b) for what group it belongs to.
Thanks in advance
Hello Justin,
One option to add a checkbox to every group header of a XamDataGrid is to merge the default styles for the XamDataGrid and copy the GroupByRecordPresenter style into your MainWindow.xaml. In the GroupByRecordPresenter style, there is a StackPanel with its Orientation set to Vertical. This StackPanel contains a ContentControl and a GroupBySummariesPresenter.
If you set that StackPanel’s Orientation to Vertical and add a CheckBox to it, you can handle the Click event of that CheckBox in the code-behind. In that click event, you can use Utilities.GetAncestorFromType to obtain the GroupByRecordPresenter that the CheckBox sits in. Then, you can obtain the group by calling GroupByRecordPresenter1.Description. To get the state of the CheckBox, you can check the IsChecked property of it.
I have attached a sample application to demonstrate the above. To help you find where to place the CheckBox, I have placed a signature reading DSE-ANDREW directly above the StackPanel.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewDeveloper Support Engineer IInfragistics Inc.www.infragistics.com/support
Hi,
I have similar situation but i need to add few controls to the group by header area(Please see screenshots attached). The value of these controls should come via binding and also we have AllowGroupBy="False". The grouping is set in the code based on the data being binding to the grid.
Hi Andrew,
Sorry for changing back this from Verified answer to not answer. It was is still 1st class support. However 10 days ago I've posted an additional question here about your solution, and maybe its green verified answer prevented the notification system to show it for you. (just a guess). For you convenience, here is my 10 days old question:
***
I've just discovered, that there is one thing what I can not know how to do with these checkboxes.
When the user clicks on a checkbox, I need to clear the other checkboxes. However I can not figure out how to access the other checkboxes in the event.
Thx, that was a 1st class support and great help.
Best regards.