How to update database ?

6 posts, 0 answers
  1. Manoj
    Manoj avatar
    75 posts
    Member since:
    Dec 2008

    Posted 13 Jan 2009 Link to this post

    Hi Team,
        I am using a tree view control to display the data from database . In my table there are 14 columns . I have implemented the load on demand . For the firtst time I am displaying second column as text and 1st column as its value . When user expanding the node I am taking that node value and displaying the next node ( 3rd column as value and 4th column as text and so on) . I cannot do this by using 3 columns in my table as "ParentId", "ChildId" and "Text" as we usually do to display the heirachical data .  I am allowing user to edit the text of the node or user can drag node from other tree view . After doing this I want to update the databse . Can you suggest me how can I able to update the database .

    Regards
    Manoj
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 13 Jan 2009 Link to this post

    Hello Manoj,

    You need to store the key of your database table in some way so you can later locate the database record corresponding to a specific tree node. If you are not able to use the Value property you can use the Category property or a custom attribute.

    Regards,
    Albert
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Manoj
    Manoj avatar
    75 posts
    Member since:
    Dec 2008

    Posted 13 Jan 2009 Link to this post

    Hi Albert,
        Thanks for your reply . Can you send me with an example .

    Regards
    Manoj
  5. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 13 Jan 2009 Link to this post

    Hello Manoj,

    Populating a custom attribute is easy - subscribe to the NodeDataBound event

           protected void RadTreeView1_NodeDataBound(object sender, RadTreeNodeEventArgs e)
           {
               e.Node.Attributes["MyAttribute"] = Convert.ToString(DataBinder.Eval(
    e.Node.DataItem, "MyColumn"));
           }

    Regards,
    Albert
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Kevin
    Kevin avatar
    16 posts
    Member since:
    Nov 2007

    Posted 04 Jan 2010 Link to this post

    Is there a way to do this on the client?  I would like to iterate through all the nodes of the different treeviews on my page, then send them to a database table.  Can you do the update via the client?

    --Kdc
  7. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 06 Jan 2010 Link to this post

    Hi Kevin,

    This is not possible. What you can do is this - use the ajaxRequest client method of the RadAjaxManager to initiate an ajax request to the server where you can update the database.
    Hope this is feasible for your case.

    Greetings,
    Veskoni
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017