Rowupdating event devexpress grid
Free counters Added on January 19,2012 Follow Me @vmsdurano A bit About Me Disclaimer The opinions expressed herein are my own personal opinions and does not represent the opinions of my employers. Contol)Text; it werk just Fine any comment and thx for the code Instead of adding a Customer ID to your table and later pulling the text to get the ID number, a more reliable way to do it is to add a Data Key Names field to the grid example in the page: You can then access this information at any time with the following in code: Grid View1. Row Index]["id"]); You can do this with any field, but I've found customers get confused when they see the ID field and kept asking me why it was there, this also eliminates any issues if you change the display order of your table later (maybe add an edit/update/cancel control) Hey...great article ;)But I got a problem... So here I go with my example:protected void Grid View1_Row Updating(object sender, Grid View Update Event Args e) and the debugger says: Exception Details: System. Nor does it represent the opinion of my dog, because I don’t have one. I have a project that I coppied the above code into. Data Keys[Row Index]["Customer ID"]in the Update event it would be something like:int Customer ID = Convert. Format Exception: Input string was not in a correct format. For a while now I’m trying to figure out why my method, triggered by the Grid View.Row Updating event, doesn’t work as all samples say it should do.When we edit a row in our Grid View and press the “Update” button, at some time it’s received in the Row Updating method.But as I noted in the comments in that method, some collections that should contain the columns (names, old values and new values) are always empty. And the Row Updated method is never even touched!!! NET Forums that I need to use a Data Source control.
But for this demo, I’ll show you the simple version, that also doesn’t work 🙂Let’s bind the data to our Grid View and have it autogenerate our columns, as well as an edit button. I would not recommend you to append the values directly into your SQL statements , use Parameterized Query instead for security and readabily of codes.. your help will be highly appreciated.error is: Error 1 'System. It just keeps getting me errors about the conversion when i'm trying to update the fields. Please review the stack trace for more information about the error and where it originated in the code.