This is basically so you can cancel the update operation.
To get what you've type in I think you need to get the new values (the Dictionary e. In your case you can use it something like this (assuming name, phone and email are what they're called in your gridview): NOTE: If you're simply using this to get the values typed in to update your database then you're better of binding the datagrid and use the value after that to ensure you definitely have the same values in the datagrid as to what you put into the database.
HTML CODE: C# Code Behind: private void Bind Data() protected void gv Categories_Row Editing(object sender, Grid View Edit Event Args e) protected void gv Categories_Row Updating(object sender, Grid View Update Event Args e) Hello Azam, Thanks for the prompt reply. Find Control("txt Category Description") as Text Box). Regards, Amol I am attempting to get the rowupdate event working with a gridview.
Text; returns the the value of the "decription" which existed prior to typing in the new value. Thus every time I would click on Update, the data would get bound to the grid again after fetching the same data from the data base. I have a webpage that has a grid that allows select as well as edit. When I attempt to get to values in the rowupdating event I get the old values (which makes sense from your post). My question is that when I add the binding code inside If Not Page.
before that i want just using Find control and casting and then retrieving all lot code. If values are same they could notify user to change the value(give new cell value).
Gridview rowupdating example c
Every one can use it to compare the new value with old ones. 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. Sql Client; public partial class _Default : System. For example, the current data is: name: Blake, phone: 123-234-3456, email: [email protected], contact Id: 22 I type in new data: name: John, phone: 555-555-5555, email: [email protected], contact Id: 22 Data that ends up in the database: name: Blake, phone: 123-234-3456, email: [email protected], contact Id: 22 When you raise the Row Updating event your basically getting the values BEFORE the Grid View updates the row.However, now I am all confused and lost with the Grid View. In the code below I have shown how you can extract the new values from the textboxes inside the Grid View. Once, you got the values you just need to send them to the database. For example: if the value of the description was "Hello how are you" and then the users hits Edit and changes this value to " am fine", in the C# file, the value obtained in the string description is still "Hello how are you". Now I moved this binding after querying module into the (! Is Post Back and click edit on the grid I no longer see the grid. How can I obtain the new value in string description? After searching long and hard I found a great article that solved my issue.Take a look at the page load if you are binding on post back then the values get updated before you are able to access them.