Hi,
My user has requested me to have check box as my first column in my grid
grouping control grid and he should be able to select or select rows based on
whether check box is selected or deselected.
I also want a select All/ Deselect All button on the header.
Do you sample code/link to acheive this?
Thanks
Inder
Hi Inder,
Thank you for your interest in Syncfusion.
Query.
Select a record based on checkbox click |
We have analyzed your query and we have implemented all things in the sample. In this sample will provide a solution for you query.
If you click the checkbox then selected record is highlighted and shown in next grid.
Please refer the attached sample. |
Here is the video file for reference : http://www.syncfusion.com/downloads/Support/DirectTrac/99884/99884_Video-783911365.zip
Please let me know if you have further concerns.
Regards,
Vinish.
Hi Jonathan,
Sorry for the
inconvenience caused with delay.
Query: Having CheckBox in the Header of
GridGroupingControl. |
Now the Selection/De-selection made in the
HeaderCheckBox will reflect in the corresponding column’s checkboxes. We have
implemented this in attached sample
also. Please refer to the following code snippet
and modified sample file. Code: void gridGroupingControl1_TableControlCellClick(object sender,GridTableControlCellClickEventArgs e) { GridTableCellStyleInfoIdentity id =
e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex,
e.Inner.ColIndex).CellIdentity as GridTableCellStyleInfoIdentity; if (id.Column != null &&
id.Column.Name == "Add Item" && id.TableCellType ==GridTableCellType.ColumnHeaderCell) { checkBoxValue =
!checkBoxValue; foreach (Record rec in e.TableControl.Table.Records) { rec.SetValue("Add Item", checkBoxValue); } } } |
Sample file : http://www.syncfusion.com/downloads/Support/DirectTrac/102225/GGC%20Header%20CheckBox-1629330622.zip
Please let me know if you have further concerns.
Vinish.
Hi Pierre,
Thank you for your interest in Syncfusion products.
Please make use of the below sample.
Sample:
http://www.syncfusion.com/downloads/support/directtrac/general/CS900373529.zip
Please let us know if you need any further assistance.
Regards,
Anish.
Hi Pierre,
Sorry for the inconvenience. Please ignore our previous update.
We suggest you to use the TableControlCheckBoxClick event and make use of the below code for selection. We have also created a sample for your convenience.
C#:
void gridGroupingControl1_TableControlCheckBoxClick(object sender, GridTableControlCellClickEventArgs e)
{
GridTableCellStyleInfo style = (GridTableCellStyleInfo)e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex, e.Inner.ColIndex);
Record currentRecord = style.TableCellIdentity.DisplayElement.GetRecord();
if (this.gridGroupingControl1.TableModel[e.Inner.RowIndex, e.Inner.ColIndex].Text == "False")
currentRecord.SetSelected(true);
else
currentRecord.SetSelected(false);
}
Sample:
http://www.syncfusion.com/downloads/support/forum/105749/ze/CS1566249275
Please let us know if you need any further assistance.
Regards,
Anish