Answer the question
In order to leave comments, you need to log in
How to get cell value from GridView?
I have DevExpress's GridLookUpEdit control, respectively, there is a GridView in it. Now, when I hover over a grid line, I want to get data from this line (ideally, of course, get EditValue). According to the FocusedRowChange event, I do:
private void gridView_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
{
var view = sender as GridView;
if (view != null)
{
MessageBox.Show(view.GetRowCellValue(e.FocusedRowHandle, view.Columns[1]).ToString());
}
}
Answer the question
In order to leave comments, you need to log in
If you just get by index, then:
private void gridView_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
{
var view = sender as GridView;
if (view != null)
{
MessageBox.Show(view[0,0].ToString());
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question