Hi,
There are two types of selection modes available for GridGroupingControl. One is inherited from the GridControlBase and the other is record based selection, that is specfic to the GridGroupingControl. Refer to the KnowledgeBase(KB) article link below for more details on this.
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=344
However, neither of the above mentioned selection modes will allow you to select columns. But TableControlCellClick event can be handled to do this. Below is the code snippet.
this.gridGroupingControl1.TableOptions.AllowSelection = GridSelectionFlags.Any; // Form_Load
ArrayList selectedColumns = new ArrayList();
private void gridGroupingControl1_TableControlCellClick(object sender, GridTableControlCellClickEventArgs e)
{
GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex,e.Inner.ColIndex)
if(style.TableCellIdentity.TableCellType == GridTableCellType.ColumnHeaderCell)
{
GridRangeInfo range = GridRangeInfo.Col(e.Inner.ColIndex);
range = range.ExpandRange(2, e.Inner.ColIndex, e.TableControl.Model.RowCount, e.Inner.ColIndex);
if(e.TableControl.Selections.Ranges.AnyRangeContains(range))
{
e.TableControl.Selections.SelectRange(range, false);
selectedColumns.Remove(style.TableCellIdentity.Column.Name);
}
else
{
e.TableControl.Selections.SelectRange(range, true);
selectedColumns.Add(style.TableCellIdentity.Column.Name);
}
}
}
Here is a sample http://www.syncfusion.com/Support/user/uploads/GGC_CompareData_d2e886a8.zip
To select a column programatically use the code below.
// selects first column...
this.gridGroupingControl1.TableModel.Selections.Add(GridRangeInfo.Cells(2,1,this.gridGroupingControl1.TableModel.RowCount, 1));
Let us know if you have any other questions.
Regards,
Rajagopal