Now, my problem is whenever I want to update that particular row, the whole column updates to date Time. is always going to be true (might as well read 1 = 1) hence it updates all rows, because all rows match the clause. I assume you actually want to compare to another identifier, not to itself.Is there something wrong with the update sql statement which might be causing this problem?
I've a sample below, the Grid View Template is bound to Category Name.
On Row Updating is fired when the 'Edit' button is clicked.
This method is commonly used when you need to update a record from outside of the Grid View control, such as from a different control on the page.
This method can be called only for the row that is currently in edit mode, or for a row that contains a two-way data-bound input control.
Now you can ask questions directly to me on my new site ASPForums.
Net Question Answer site, specially started to allow visitors of this site ask their doubts and queries. Just click the Ask Now button and ask your question now.
The Textbox values come back as empty, which is even stranger. Below is the code for both the Grid View HTML and the C# code behind.
Code (C# On Updating Event) protected void gv Main_Row Updating(object sender, Grid View Update Event Args e) Gridview HTML Code x WHERE (Rec ID = @Rec ID) " Select Command="SELECT Rec ID, Company ID, Region ID, Country ID, Company Code, Company Name, App ID, Country Code, Country Name, Region Company ID, Region, Model Name, Translate Model, Price, Last Updated On, Last Updated By FROM dbo.
w=800" src="https://taditdash.files.wordpress.com/2014/06/debugger-inside-gridview-rowupdating-event.png? w=800&h=359" alt="Debugger Inside Grid View Row Updating Event" width="800" height="359" class="size-full wp-image-328" srcset="https://taditdash.files.wordpress.com/2014/06/debugger-inside-gridview-rowupdating-event.png? w=230" src="https://taditdash.files.wordpress.com/2014/06/gridview-on-browser.png? w=800" alt="Grid View on Browser" class="size-full wp-image-335" srcset="https://taditdash.files.wordpress.com/2014/06/230w, https://taditdash.files.wordpress.com/2014/06/gridview-on-browser.png? w=416" src="https://taditdash.files.wordpress.com/2014/06/gridview-cell-showing-updated-value.png? w=800" alt="Grid View Cell Showing Updated Value" class="size-full wp-image-331" srcset="https://taditdash.files.wordpress.com/2014/06/416w, https://taditdash.files.wordpress.com/2014/06/gridview-cell-showing-updated-value.png?
If we move our mouse on to the variables, which hold the cell values, we can see the old value instead of new updated value (Refer the debugging Screen Shot at the Top).
Edit Index = -1; after debugging code with breakpoint this it goes back to page and it shows gridview with below and if I want change quantity=67 and click update .