How do you access the value of a cell in a Windows form datagrid?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do you access the value of a cell in a Windows form datagrid?

I know this is how you would do it using an ASP.NET datagrid:
DataGrid1.Items[1].Cells[1].Text

However, "Items" is not available in the Windows Forms datagrid.

Thanks,

Paul
 
You access it by using the indexer like the follwoing code snippet:

DataGrid dg = new DataGrid();
object cellValue = dg[1,1];

I hope this helps.

Jon
 
Thanks! That worked!

- Paul

CodeMeister said:
You access it by using the indexer like the follwoing code snippet:

DataGrid dg = new DataGrid();
object cellValue = dg[1,1];

I hope this helps.

Jon

Paul Daly (MCP) said:
How do you access the value of a cell in a Windows form datagrid?

I know this is how you would do it using an ASP.NET datagrid:
DataGrid1.Items[1].Cells[1].Text

However, "Items" is not available in the Windows Forms datagrid.

Thanks,

Paul
 
Back
Top