How to save a TreeView ?

Discussion in 'ASP .Net Web Controls' started by Polaris, Jun 4, 2007.

  1. Polaris

    Polaris Guest

    Hi Experts:



    I'm using ASP.NET 2.0. I'm using a TreeView control with a design-time
    configured XmlDataSource (an XML file). I use the TreeView control as a
    "message board" with each node representing a message. I noticed that the
    TreeView loads alright from the XML file but did not save anything. I call
    the TreeView.Save() for each new node added into the TreeView. What I'm
    missing here?



    Thanks in advance!

    Polaris
     
    Polaris, Jun 4, 2007
    #1
    1. Advertising

  2. Polaris

    PlatinumBay Guest

    Polaris,

    I don't see a Save on either the TreeView or TreeNode controls. I do not
    believe that the default TreeView has this functionality.

    The XmlDataSource object does have a Save method, however. I would suggest
    that when a TreeNode is added, removed or changed, that you capture those
    events and update the XmlDataSource accordingly. You may wish to rebind the
    control as well after making changes.

    This article lists some code for the TreeView SelectedNodeChanged event:
    http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.xmldatasource.save(VS.80).aspx

    Hope this helps,


    Steve



    "Polaris" <> wrote in message
    news:...
    > Hi Experts:
    >
    >
    >
    > I'm using ASP.NET 2.0. I'm using a TreeView control with a design-time
    > configured XmlDataSource (an XML file). I use the TreeView control as a
    > "message board" with each node representing a message. I noticed that the
    > TreeView loads alright from the XML file but did not save anything. I call
    > the TreeView.Save() for each new node added into the TreeView. What I'm
    > missing here?
    >
    >
    >
    > Thanks in advance!
    >
    > Polaris
    >
    >
    >
    >
     
    PlatinumBay, Jun 5, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. user
    Replies:
    1
    Views:
    765
    Bruce Barker
    Apr 4, 2005
  2. teo
    Replies:
    1
    Views:
    465
  3. BusyBoy
    Replies:
    2
    Views:
    604
    =?Utf-8?B?TGVvbiBNYXluZQ==?=
    Oct 31, 2006
  4. subhadip
    Replies:
    0
    Views:
    637
    subhadip
    Mar 28, 2007
  5. hell2heaven
    Replies:
    0
    Views:
    416
    hell2heaven
    Oct 26, 2008
Loading...

Share This Page