This is a migrated thread and some comments may be shown as answers.

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

1 Answer 38 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Tyler
Top achievements
Rank 1
Tyler asked on 28 Dec 2010, 12:35 AM
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?

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 28 Dec 2010, 03:14 PM
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.
Tags
Ajax
Asked by
Tyler
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or