JJ
Jisha Joy
Syncfusion Team
August 14, 2008 10:40 AM UTC
HiSumit,
We appreciate your interest in Syncfusion Products.
If you have the inherited GridControlBase selection(GridSelectionFlags.Any), by setting the ListBoxSelectionMode to none. Then, you could use the code below to get the selected rows and the number of selected rows. The grid.TableControl.Model.SelectionChanging/SelectionChanged are the events that get triggered when doing selections.
this.gridGroupingControl1.TableOptions.AllowSelection = GridSelectionFlags.Any;
this.gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.None;
GridTableControl tc = this.gridGroupingControl1.TableControl;
if (tc.Selections.Ranges.ActiveRange.IsRows)
Console.WriteLine("No of rows selected: {0}", tc.Selections.Ranges.ActiveRange.Height);
GridRangeInfoList rangeList = tc.Selections.GetSelectedRows(true, false);
if (rangeList.Count > 0)
{
foreach (GridRangeInfo range in rangeList)
{
for (int row = range.Top; row <= range.Bottom; ++row)
{
Console.WriteLine(this.gridGroupingControl1.Table.DisplayElements[row].ToString());
}
}
}
Cut-copy feature in the control
Please refer the following browser sample:
MyDocuments\Syncfusion\EssentialStudio\6.3.0.30\Windows\Grid.Grouping.Windows\Samples\2.0\FeaturedSamples\CutCopyPasteSample\cs
This sample allows you to perform cut, copy and paste operations with an hierarchical GridGroupingControl. In this sample, the gridgroupingcontrol is bound to an hierarchical dataset comprising of two tables. A Context Menu is associated with the grouping grid to enable the required clipboard operations.
Regards,
Jisha