Text value of DataGrid cell - Webforms

  • Thread starter Thread starter Eddie B.
  • Start date Start date
E

Eddie B.

How do you get the text value of a DataGrid in a WebForm? I am doing all of
my DataBinding @ runtime.
 
Try doing the following:

for(int i = 0; i < dataGrid.Items.Count; i++)
{
string foo = dataGrid.Items.Cells[column].Text;
// for text in a cell
string foo =
((TextBox)dataGrid.Items.Cells[column].Controls[1]).Text; // for text
in a textbox in a cell
}

--
This posting is provided "AS IS" with no warranties, and confers no rights.

Thanks
Shawn Rothlisberger
CLR Performance Test
 
Back
Top