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

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
 
C

CodeMeister

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
 
G

Guest

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
 

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