.NET, a datagrid & a roundhouse trip to a databse I could do without
-
Hi guys, I have an editable datagrid which loads values from a sqlserver database and also allows to edit & delete the respective elements when needed. I have currently also included a seperate add utility in the form of textboxes and an add button which enters all textbox values into the databse and binds the datagrid showing the newly entered row. The thing is this all doing very well BUT the problem is that these additions and updations all require a round trip to the database updating and deleting entries directly from the databse. I want that the datagrid allows editing and edition of values in the datagrid but doesn't upodate the database until I say so, like I could put a 'save all' button that updates the changed values in the datagrid to the database in ONE go. Any solutions , source code snippets would be greatly appreciated:D
-
Hi guys, I have an editable datagrid which loads values from a sqlserver database and also allows to edit & delete the respective elements when needed. I have currently also included a seperate add utility in the form of textboxes and an add button which enters all textbox values into the databse and binds the datagrid showing the newly entered row. The thing is this all doing very well BUT the problem is that these additions and updations all require a round trip to the database updating and deleting entries directly from the databse. I want that the datagrid allows editing and edition of values in the datagrid but doesn't upodate the database until I say so, like I could put a 'save all' button that updates the changed values in the datagrid to the database in ONE go. Any solutions , source code snippets would be greatly appreciated:D
I don't think it is possible with the current datagrid control. It requires a roundtrip (when updating) to set the ItemIndex property to a row and render itself. The only way I see this working is to create a html table with javascript and stuff. But it will not be an easy way. I may be wrong ;P sebastien.lachance.blogspot.com