Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
6637 | Aug 20,2003 09:18 PM UTC | Aug 20,2003 10:02 PM UTC | WinForms | 1 |
![]() |
Tags: GridControl |
private void button1_Click(object sender, EventArgs e) { int totalRows = 0; string printRows = "rows: "; foreach(GridRangeInfo range in this.gridControl1.Selections.GetSelectedRows(true,false)) { totalRows += range.Bottom - range.Top + 1; for(int i = range.Top; i <= range.Bottom; i++) { printRows += i.ToString()+" "; } } MessageBox.Show(string.Format("Total Rows: {0} Rows: {1}", totalRows, printRows)); }To delete a record at a rowindex in the grid, you can use: gridDataBoundGrid1.DeleteRecordsAtRowIndex Or, you can also use gridDataBoundGrid1.Binder.RemoveRecords. But to use this, you need to use gridDataBoundGrid1.Binder.RowIndexToPosition to convert the rowindex to a record position.
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.