Editing Multiple Rows At Once in datagrid -- Please help

R

Reetu

Hi all,

I am referring to one of the msdn articles which explains
how to edit multiple rows at once in datagrid.

Query:
In pageload the datagrid is displayed with data in it. In
the textbox(contained in the datagrid) I change the data
and click on the save button located on the web form.

Now I am expecting the edited value to be available in my
following code.

txtQuantity = (TextBox) dgi.FindControl("txtQuantity");

But I see that the textbox retains the previous value.
here is the code I am using.

Can someone please tell me why I am getting the initial
value instead of the modified value.

int i;
DataGridItem dgi;
TextBox txtQuantity;
Label lblDescription;
Label lblPrice;
Label lblTotal;

for(i = 0; i <= DataGrid1.Items.Count -1 ; i++)
{
dgi = DataGrid1.Items;
txtQuantity = (TextBox) dgi.FindControl("txtQuantity");
lblDescription = (Label)dgi.FindControl("lblDescription");
lblPrice = (Label)dgi.FindControl("lblPrice");
lblTotal = (Label)dgi.FindControl("lblTotal");
.......
}

Thanks & Regards,
-Reetu
 
R

Reetu

Hi all,

I got it working. I need to set the
DataGrid.EnableViewstate property to false.

Thanks,
-Reetu
 

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,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top