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
Hi andrew
I have a xamdata grid in that i need to add checkbox iam using infragictic version 10.3 .
below code iam using to add checkbox but nor working as expected
<igDP:UnboundField Label="CheckBox field" Name="chk"> <igDP:UnboundField.Settings> <igDP:FieldSettings EditorType="{x:Type igEditors:XamCheckEditor}"/> </igDP:UnboundField.Settings> </igDP:UnboundField>
Hello Sunil,
I am under the impression that by adding a button to the "last column" you are referring to placing the button after the header that in the above sample project reads <name> (X items). If this is incorrect, please let me know as the following is based upon that impression.
In order to do this, I would recommend taking a look at the sample project attached above. If you go into the GroupByRecordPresenterDictionary.xaml and look at the ControlTemplate for the GroupByRecordPresenter style, you will find a Checkbox, Button and ContentControl that all exist within a StackPanel oriented horizontally. If you place the Button after the ContentControl in the XAML, but still within that StackPanel, it will appear after the header text.
Please let me know if you have any other questions or concerns on this matter.
Hello Andrew, I have a requirement bit similar but want to add button to the last column of the group by area . How can I achieve that? as adding to the beginning messes up the summary calculation alignment.
Thanks
Hello All,
I have put together a new and improved sample project that implements each of the three requirements mentioned above. I will section the description of each piece by the name of each person below:
Vikram: In order to do this, I would recommend utilizing the Tag property of the underlying GroupByRecord on the GroupByRecordPresenter. This is the DataContext of the GroupByRecordPresenter, and as such, the DataContext of everything in its template as well. The XamDataGrid.Records collection will contain these GroupByRecords, and so if you set the Tag to "false" on load, handle the Checkbox.Checked/Unchecked events on your HeaderPrefixArea checkbox, use the Infragistics.Windows.Utilities class as mentioned in the original response to this thread to get the XamDataGrid, and then loop through each GroupByRecord in the XamDataGrid.Records collection, you can set the Tag of each to correspond with the checked state of the checkbox.
Aziz: The GroupByRecord that serves as the DataContext to the GroupByRecordPresenter has a DataPresenter property that returns the XamDataGrid. From this, you can bind to DataPresenter.DataContext to get the DataContext of the grid, which I imagine would be your ViewModel. If your ViewModel has a property that references the command that you are looking to bind, you can bind to it in this way on the Button that would be placed in the GroupByRecordPresenter template.
Kumar: Similar to Aziz's requirement in this case, you can use the same type of binding to bind to a property on your ViewModel. This is demonstrated in the sample project as the Content of the Button is bound to a string property in the ViewModel.
I am attaching a sample project that demonstrates each of the three above requirements. I hope this helps.
XDGGroupByCheckBoxDemo.zip
Hello,
I have a similar issue. I want to add a button to the Group by header and bind a command to it. Is there a way to do that ?