Using RadAJAX + LINQ to update single rows in nested Data controls

3 posts, 1 answers
  1. Javier
    Javier avatar
    5 posts
    Member since:
    Oct 2006

    Posted 27 Apr 2008 Link to this post


    Requirements

    RadControls version

    RadControls for ASP.NET AJAX
    .NET version

    2.0 or above
    Visual Studio version

    2005, 2008 recommended
    programming language

    C#
    browser support

    all browsers supported by RadControls


     
    PROJECT DESCRIPTION
    I decided to update my older article "Updating individual Items/Rows inside complex Data controls" now that telerik has released the final version of the RadControls for ASP.NET AJAX but when I was going through the code that I made long ago I realized I didn't need to create special data access and business logic classes when I can easily use LINQ instead.

    So here it is, the functionality of this sample is basically the same of the old one, a list of tasks grouped by the list name. When you click on the edit button on each task a textbox appears and you can update the text of the particular task using that form. The important part is how this is handled in the code, as I use RadAJAX to update ONLY the row that is being modified.

    The sample uses two simple Repeater controls to display the data, the outer one displays the Lists and the inner/nested one displays the Tasks for each List. This one is loaded on demand firing the itemDataBound event on the outer Repeater. The AJAX functionality is achieved by placing both Repeaters inside two RadAjaxPanels and creating the AjaxSettings at runtime each time a task is bound to its Repeater.

    I also added the LoadingPanel to this sample as it has been vastly improved since I wrote the last article, assigning it to the DefaultLoadingPanel property of the RadAjaxManager does the trick, it only covers the inner panel instead of the outer one.

    Again I only implemented the edit button, but if you go through the code you will see how easy can be to add the Add/Edit/Delete for the rest of the sample using LINQ.
    Remember you will have to rebuild the project if you do changes to the database and refresh the LINQ file in the App_Code folder.

    I am using this sample to create a simple forums/threads page to show how easy this is done using RadAJAX and LINQ.

    Thanks.



  2. Answer
    Konstantin Petkov
    Admin
    Konstantin Petkov avatar
    1911 posts

    Posted 01 May 2008 Link to this post

    Hi Javier,

    Thank you for your efforts on creating a RadAjax and LINQ with nested Data controls project. We will review the code carefully prior to publishing it as well.

    Your efforts are highly appreciated! Thank you for the submission!

    All the best,
    Konstantin Petkov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 10 May 2008 Link to this post

    Hello Javier,

    Thank you for posting the updated version of your previous example using LINQ to bind the content of the repeater. We really appreciate your effort to convert the demo to use the ASP.NET AJAX version of our control and as a token of gratitude I added 7000 Telerik points to your account which you can use as a discount for future purchases/upgrades of our controls.

    Happy coding!

    Best regards,
    Stephen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top