Datagrid Reference - How to

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

Guest

I have a datagrid column which had the following setting: ReadOnly="False".
I recently changed it to: ReadOnly="True". Since changing it I can no longer
reference the column using the following syntax...

e.Item.Cells(9).Controls(0), TextBox).Text (this worked when ReadOnly="False")
-nor-
e.Item.Cells(9).Controls(0), Label).Text

What is the correct syntax that I should use? Thanks.
 
Hi Mike,

Your code is incomplete, but if e is a datagrid you could do something like

e.Items[row number].Cells[column number].ToString(); // C#

which would be something like

e.Items(row number).Cells(column number).ToString() // vb

Happy Coding!
Morten Wennevik [C# MVP]
 
Back
Top