The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I am using Gridgroupingcontrol. I want to implement excel type cut-copy feature in the control. When I am using this.m_adminDataGridViewControl.TableOptions.AllowSelection = GridSelectionFlags.None; It doesn't allow to select individual cells . When I am using
this.m_adminDataGridViewControl.TableOptions.AllowSelection = GridSelectionFlags.Any I am not able to get selected records.
JJJisha 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()); } } }
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.