Hi there...
You could use the CurrencyManager Class as shown below (asigning value to label1.Text) or
using datagrid's CurrentCell property (label2.Text).
private void dataGrid1_Curre ntCellChanged(o bject sender, System.EventArg s e) {
CurrencyManager cm = (CurrencyManage r) dataGrid1.Bindi ngContext[dataSet11.Table s[0]];
label1.Text = cm.Position > -1 ? ((DataRowView) cm.Current).Row[dataGrid1.Curre ntCell.ColumnNu mber].ToString() :
string.Empty;
label2.Text = dataSet11.Table s[0].Rows[dataGrid1.Curre ntCell.RowNumbe r]
[dataGrid1.Curre ntCell.ColumnNu mber].ToString();
}
Regards,
--
Angel J. Hernández M.
MCSD
"Steph." <st***@nomail.c om> escribió en el mensaje news:O2******** ******@TK2MSFTN GP09.phx.gbl...
Hi,
I would like to get the Data of a given cell in the datagrid something like :
MyStringVar = MyDataGrid.Tabl eStyles[0].Cell[X,Y].ToString();
But I can't find any way to read the data of a given cell, or row.....
Any Idea ?
Thanks for help,
Steph.
_______________ _______________ _______________ _______________ __
Stephane Orban
IT Manager
EOLE-UNICLAM
EMail :
in**********@un iclam.com
Web :
www.uniclam.com
Tel : +32 (0) 2 227 54 98
Fax : +32(0) 2 218 74 60