Hi Tanmaya,
Thank you for your interest in Syncfusion products.
If
you want to select the checkbox and sort the record based on order, you can use
the “TableControlCheckBoxClick”
event. By this event, you can set the “GetRecord”
method. Please refer the below code,
Code:
this.gridGroupingControl1.TableControlCheckBoxClick
+= new Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCellClickEventHandler(gridGroupingControl1_TableControlCheckBoxClick);
void gridGroupingControl1_TableControlCheckBoxClick(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCellClickEventArgs e)
{
GridTableCellStyleInfo style = (GridTableCellStyleInfo)e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex, e.Inner.ColIndex);
Record r = style.TableCellIdentity.DisplayElement.GetRecord();
int index = e.TableControl.Table.DisplayElements.IndexOf(r);
this.gridGroupingControl1.TableControl.CurrentCell.EndEdit();
string val = r.GetValue("Add Item").ToString();
}
Please let us know if you have any
concern.
Regards,
Muthukumar K
Hi Tanmaya,
Thanks for the update.
If you want to sort particular column you can use ”TableControlQueryAllowSortColumn” event and remaining columns are disabled the sorting operation. We have modified your attached sample. Please refer to it.
Code:
this.gridGroupingControl1.TableControlQueryAllowSortColumn += new Syncfusion.Windows.Forms.Grid.Grouping.GridQueryAllowSortColumnEventHandler(gridGroupingControl1_TableControlQueryAllowSortColumn);
void gridGroupingControl1_TableControlQueryAllowSortColumn(object sender, GridQueryAllowSortColumnEventArgs e)
{
if (e.Column.Name == "Add Item")
e.AllowSort = true;
else
e.AllowSort = false;
}
Please let us know if you have any concern.
Regards,
Muthukumar K