Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
26462 | Mar 23,2005 02:38 PM UTC | Mar 23,2005 03:44 PM UTC | WinForms | 1 |
![]() |
Tags: GridControl |
int colIndex = grid.Binder.NameToColIndex("TestValueColname");
object testValue = grid[e.RowIndex, colIndex].CellValue;
If the value is not displayed in teh grid and you need to get it from teh datassource, then you have to use the CurrencyManager.
CurrencyManager cm = grid.BindingContext[grid.DataSoource, grid.DataMember] as CurrencyManager;
int pos = grid.Binder.RowIndexToPosition(e.RowIndex);
object testValue = ((DataRowView)cm.List[pos])["TextValueColName"];
In this latter case, I think you could cache teh currencymanager in a class member and initialize this member after you set teh datasource to teh grid. 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.