ASP.NET Web Controls >> data grid ques

by netques » Wed, 20 Aug 2003 09:54:17 GMT

Need help:

I am loading the values to data grid's bound columns and
Item Templates (Text boxes)

Once the users changes the Data grid's textbox values, how
to get the text box value.

I can retrieve the bound column values but not the values
which are in Item template columns

To get the bound column value
datagrid.Items(X).cells(x).item.text or something like that
this is giving me only bound column values

Thanks for any help

Thanks for any help



ASP.NET Web Controls >> data grid ques

by Angela » Wed, 20 Aug 2003 23:55:47 GMT


foreach(DataGridItem dgi in _dataGrid.Items){
string tmp = (TextBox)dgi.Cells[0].Controls[0]).Text
string tmp1 = ((DropDownList)dgi.Cells[2].Controls
[0]).SelectedItem.Value
}//End foreach

Loop through the rows in the DataGrid using foreach.
The first line in the loop retrieves the values of items
in a TemplateColumn of TextBoxes. The second line in the
loop retrieves the values of items in a TemplateColumn of
DropDownLists. You can apply these examples to
TemplateColumns of other WebControls.


how
that