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 GridDataBoundGrid and need to get the contents of the selected rows. I am looking something like the DataGridViewSelectedRowCollection in windows forms.
I am using the MultiExtended selection mode as below:
_aggregateGrid.ListBoxSelectionMode = SelectionMode.MultiExtended; [so that whole rows are selected instead of individual cells]
If the user selects 2 rows, how do I get the contents of the selected rows(I need to get the cell values as well). Also I need to find out which cell was selected first.
I tried using :
GridRangeInfoList rangeList = new GridRangeInfoList(); _aggregateGrid.Selections.GetSelectedRanges(out rangeList, true); if (rangeList.Count > 0) { foreach (GridRangeInfo range in rangeList) { GridStyleInfo[] info = _aggregateGrid.Model.GetCellsInfo(range);
LSLingaraj S Syncfusion Team May 23, 2009 06:47 AM UTC
Hi Tanmay,
Thank you for your interest in Syncfusion product.
If you want to get the selected cells in GridDataBoundControl. Please try using GridRangeInfo properties to acheive this behaviour.
Please refer the code below: GridRangeInfoList list; if(this.gridDataBoundGrid1.Selections.GetSelectedRanges(out list, true)) { foreach(GridRangeInfo range in list) { List range = new List(); for(int i = range.Top; i <= range.Bottom; i++) for(int j= range.Left; j <= range.Right; j++) range.Add(GridRangeInfo.Cell(i,j)); } }