data grid ques

N

netques

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
 
A

Angela

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.
 

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

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top