2-way DataBinding using separate usercontrols as forms for edit/insert

2 posts, 0 answers
  1. Tyler
    Tyler avatar
    2 posts
    Member since:
    Nov 2009

    Posted 27 Dec 2010 Link to this post

    I've searched your site and the web for days and cannot find an answer to this.  I have a RadGrid with a detail table (GridTableView).  My detail table has an edit column that I want to use to update my database via the updatestatement from the sqldatasource.  I also want to be able to insert new records in my detail table, but using a different form for inserts.  Per your site, I have created two user controls (ascx files) that have each of my forms for inserting and updating, and am able to display the correct one when clicking the appropriate link.  My problem is that when I click the respective submit button, the values passed via my updateparameters or insertparameters to the updatestatment and insertstatment of my sqldatasource are all null.  I have implemented the global dataitem in my usercontrol, and am able to display values on the usercontrols using the <#% Bind() %> syntax, however it appears to be a one-way binding.  How can I configure the usercontrol to bind 2-way so that the update and insert commands of the sqldatasource work properly?  Every work around I've seen requires a bunch of code and handling of events like needdatasource.  This seems like it should be simple as I just need to get the values from my form to my parameters passed to my sqldatasource.  If I implement one form as a template I can get it to work, but how do I do it using seperate usercontrols and also using sqldatasource as my datasource?
  2. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 28 Dec 2010 Link to this post

    Hi Tyler,

    If you want to implement automatic CRUD operation with user control edit form, follow the solution provided in this blog post.

    Greetings,
    Iana
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top