Last post Apr 17, 2009 08:09 PM by ronoaldo
Apr 15, 2009 11:33 PM|ronoaldo|LINK
How to get the Keys IDictionary filled to use a custom DataSourceView (and a Custom DataSourceControl) with an editable GridView?
My code runs almost ok, until the user click on "Update" button. The ExecuteUpdate method is called, but without the keys property contents, only visible values on GridView (new and old).
How to get this working? Any sample code is welcome :)
Apr 17, 2009 02:05 AM|Allen Chen – MSFT|LINK
Could you clarify your scenario? What's ExecuteUpdate method? Please paste your current code here.
Apr 17, 2009 08:09 PM|ronoaldo|LINK
Hi Allen, thank's for your replay.
Sorry, let me explain. I'm building an NHibernate ASP.Net application, using NHibernate 2.0.1 and NHibernate.Linq. To use the GridView with NHibernate performing the Edit/Update/Delete functions, I'm also building an DataSourceControl, from this base class.
After reading MSDN docs, and a few tutorials, I was trying to override the
ExecuteUpdate method from my DataSourceView inherited class, to enable the update feature. My method recieved no keys on the
IDictionary keys parameter from GridView on my tests.
Alfter some hacking and refactoring with the code, I discovered my mistake. The GridView attribute
DataKeyNames was empty on the aspx file. So, setting it to the correct value, makes my ExecupteUpdate, and latter the Delete implementation works like a charm!
Thanks for the help, anyway. I'll build a how to for this on my Blog.