B
Borked Pseudo Mailed
Hi,
I have a Datagrid with template columns (TextBox and Radiolist in them).
The ViewState seems to work but I'm unable to access the values of the
controls in the Datagrid at Page_Load(). The code
foreach ( DataGridItem dgi in MyGrid.Items )
{
System.Diagnostics.Debug.WriteLine( string.Format( "Count: {0}",
dgi.Cells.Count) );
System.Diagnostics.Debug.WriteLine( string.Format( "Text: {0}",
dgi.Cells[0].Text) );
System.Diagnostics.Debug.WriteLine( string.Format( "Text: {0}",
dgi.Cells[1].Text) );
System.Diagnostics.Debug.WriteLine( string.Format( "Text: {0}",
dgi.Cells[2].Text) );
}
returns an empty string for all the text values, even though the Count
value returns a correct value (the number of columns).
Any idea how I can read the values from the controls?
Thanks in advance
I have a Datagrid with template columns (TextBox and Radiolist in them).
The ViewState seems to work but I'm unable to access the values of the
controls in the Datagrid at Page_Load(). The code
foreach ( DataGridItem dgi in MyGrid.Items )
{
System.Diagnostics.Debug.WriteLine( string.Format( "Count: {0}",
dgi.Cells.Count) );
System.Diagnostics.Debug.WriteLine( string.Format( "Text: {0}",
dgi.Cells[0].Text) );
System.Diagnostics.Debug.WriteLine( string.Format( "Text: {0}",
dgi.Cells[1].Text) );
System.Diagnostics.Debug.WriteLine( string.Format( "Text: {0}",
dgi.Cells[2].Text) );
}
returns an empty string for all the text values, even though the Count
value returns a correct value (the number of columns).
Any idea how I can read the values from the controls?
Thanks in advance