|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Refreshing TreeViewI have a question about Microsoft TreeView Web Control . How can I refresh the TreeView ? I am getting TreeView Nodes from Microsoft Sqlserver database I want to say that , I can`t refresh TreeView after adding a new row to database I can add a new Node using this private void btnAddMenu_Click(object sender, System.EventArgs e) { TreeNode selected_node=new TreeNode(); selected_node=TreeView1.GetNodeFromIndex(TreeView1.SelectedNodeIndex.ToString()); string menu_name=Util.ClearStringForSql(txtAddUpdateMenu.Text); // new node name from textbox TreeNode node=new TreeNode(); node.Text=menu_name; selected_node.Nodes.Add(node); } But, I don`t want to add new node like that sample ..... I want to add a new record to database and then refresh TreeView ... But , I can`t .... When I am adding a new record to database ,I cannot see new added Node in treeview. How can I make it reload? Can you help me? Regards, I. If you have a TreeView whose DataSourceID is set to a DataSourceObject and
you updated the database then, I think, you can call the TreeView.DataBind() in the codebehind to refresh the TreeView. Show quoteHide quote "Ira" wrote: > Hello . > > I have a question about Microsoft TreeView Web Control . > > How can I refresh the TreeView ? > > I am getting TreeView Nodes from Microsoft Sqlserver database > > I want to say that , I can`t refresh TreeView after adding a new row to > database > > I can add a new Node using this > > private void btnAddMenu_Click(object sender, System.EventArgs e) > { > TreeNode selected_node=new TreeNode(); > selected_node=TreeView1.GetNodeFromIndex(TreeView1.SelectedNodeIndex.ToString()); > string menu_name=Util.ClearStringForSql(txtAddUpdateMenu.Text); > // new node name from textbox > TreeNode node=new TreeNode(); > node.Text=menu_name; > selected_node.Nodes.Add(node); > > } > > But, I don`t want to add new node like that sample ..... > > I want to add a new record to database and then refresh TreeView ... > > But , I can`t .... > > When I am adding a new record to database ,I cannot see new added Node in > treeview. How can I make it reload? > > Can you help me? > Regards, > I. Hello,
I have DataSourceId and I set DataSourceObject - I actually implemeted all HierarchicalDataSourceControl in my Control which I bound to the tree, but TreeView.DataBind() doesnt work when I add additional data to the database. It doesn't refresh the tree. Do you have any other ideas? I. Show quoteHide quote "Phillip Williams" wrote: > > If you have a TreeView whose DataSourceID is set to a DataSourceObject and > you updated the database then, I think, you can call the TreeView.DataBind() > in the codebehind to refresh the TreeView. > > -- > HTH, > Phillip Williams > http://www.societopia.net > http://www.webswapp.com > > > "Ira" wrote: > > > Hello . > > > > I have a question about Microsoft TreeView Web Control . > > > > How can I refresh the TreeView ? > > > > I am getting TreeView Nodes from Microsoft Sqlserver database > > > > I want to say that , I can`t refresh TreeView after adding a new row to > > database > > > > I can add a new Node using this > > > > private void btnAddMenu_Click(object sender, System.EventArgs e) > > { > > TreeNode selected_node=new TreeNode(); > > selected_node=TreeView1.GetNodeFromIndex(TreeView1.SelectedNodeIndex.ToString()); > > string menu_name=Util.ClearStringForSql(txtAddUpdateMenu.Text); > > // new node name from textbox > > TreeNode node=new TreeNode(); > > node.Text=menu_name; > > selected_node.Nodes.Add(node); > > > > } > > > > But, I don`t want to add new node like that sample ..... > > > > I want to add a new record to database and then refresh TreeView ... > > > > But , I can`t .... > > > > When I am adding a new record to database ,I cannot see new added Node in > > treeview. How can I make it reload? > > > > Can you help me? > > Regards, > > I.
Major problem with FileUpload if bad filename
FormView - FindControl only works for default view Dynamic control creation. Bind data to control inside a Repeater Launch a new browser window Any advantage to FormView? GridView, sorting, DataTable, and typing. enable/disable text box based on dropdownlist via javascript repeater control - change the background color depending on a value CrossPage Posting and the How Do I Webcast |
|||||||||||||||||||||||