Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
6017 | Jul 29,2003 05:20 AM UTC | Jul 30,2003 08:00 AM UTC | WinForms | 7 |
![]() |
Tags: GridControl |
GridRangeInfoList ranges = this.grid.Selections.GetSelectedRows(true, false); foreach(GridRangeInfo range in ranges) { for(int i = range.Top; i <= range.Bottom; ++i) { string value_Col1 = grid[i, 1].Text; Console.WriteLine(string.Format("Row {0} selected - value in col1: {1}", i, value_Col1)); } }
int row = this.grid.CurrentCell.RowIndex;
If you are using a ListBoxSelectionMode = One, then you can get the row with code like:
int row = this.grid.Selections.GetSelectedRows(true, false).ActiveRange.Top;
CurrencyManager cm = (CurrencyManager) this.BindingContext[this.gridDataBoundGrid1.DataSource, this.gridDataBoundGrid1.DataMember];
int pos = this.grid.Binder.RowIndexToPosition(gridRowIndex);
DataRowView drv = (DataRowView)cm.List[pos];
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.