DataGrid

A

A.J

I am trying to put the selected cell in the datagrid into a
textbox(using currentcellchanged event).
----------------------------
DataGridCell currentcell;
string currentcelldata;
currentcell = dgrTest.CurrentCell;
currentcelldata =
dgrTest(currentcell.RowNumber,currentcell.ColumnNumber);
//don't know how to convert this into string


textBox1.Text = currentcelldata;
 
V

vj

dgrTest[currentcell.RowNumber,currentcell.ColumnNumber].ToString();

or

(string)dgrTest[currentcell.RowNumber,currentcell.ColumnNumber];

HTH
VJ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top