Good evening,someone asked me to help her with fixing some code for asp.net, she showed me her code but I couldn’t find a way to fix it .So I’m wondering if someone would take his time to help me fixing it.
As she said , she’s using asp.net ( net f.4 ) .On a page she added a gridview and used a sqldatasource to bind the information from data table to the gridview .
-
The aim is , on the GridView row_updating if the condition is true
then a certain cell of the current editing row will be updated with a
new value.
But , here is the problem : -
Let’s say I have two rows on the gridview!
- If I click the edit button of the first row and then press the update button nothing happens.
- But when I click the edit button of the second row then I can see the
updated value for the cell updated of the first row and If I click update or cancel I
can’t see the value anymore. - And in the datatable the value is not updated.
Can someone help me fix it?
Thanks
Thats because you are not updating your gridview after executing Update statement. You need to call DataBind() after update on gridview