We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

GDBG selection

Hi,, I am using following code to find the selected rows, Then I am deleting those rows from grid (basically deleting from table) this.gdbgSelectedCompany.BeginUpdate(); DataRow selectedRow; DataTable selectedSource = ((DataView)this.gdbgSelectedCompany.DataSource).Table; System.Collections.ArrayList al = new ArrayList(); //GridRangeInfoList rangeList = this.gdbgSelectedCompany.Selections.GetSelectedRows(false, true); GridRangeInfoList rangeList = this.gdbgSelectedCompany.Selections.GetSelectedRows(true, true); foreach(GridRangeInfo range in rangeList) { for (int row=range.Top; row <= range.Bottom;row++) { selectedRow = selectedSource.Rows[row -1]; al.Add(selectedRow); } } for (int i=0; i 0 private int GDBGSelectedRowsCount() { int rowCount=0; GridRangeInfoList rangeList = // this.gdbgSelectedCompany.Selections.GetSelectedRows(false, true); this.gdbgSelectedCompany.Selections.GetSelectedRows(true, true); foreach(GridRangeInfo range in rangeList) { rowCount = rowCount +( range.Bottom - range.Top + 1); } return rowCount; } test_6326.zip

1 Reply

AD Administrator Syncfusion Team April 15, 2005 06:45 PM

Rty using gridDataBoundGrid1.Selections.GetSelectedRows(true,false) so the currentcell is not always counted.

Loader.
Live Chat Icon For mobile
Up arrow icon