|
Rank: Member Groups: Member
Joined: 4/4/2013 Posts: 10
|
Hi,
First of all, I want to say that you guys are a great support team. My previous question was answered quickly. Eo seems to be right thing to do for my project. I have a Treeview which has a context menu on it, as well as the clickevent to change the contents of a grid. Works fabulously, again thank you guys.
My question is, when I do load, I have the first node (root node) showing, and need to click on that '+' to xpand the level. I want this done as soon as the page loads.
Also, I am missing something when the user clicks on the node, even though I have node.selected = true, nothing happens, help me in these two areas.
<EO:TreeView id="TreeView1" runat="server" ImageUrl="00030301" Expanded="true" AutoSelectSource="ItemClick" OnItemClick="treeviewclicked" ClientSideOnContextMenu="ShowContextMenu" ControlSkinID="None" Height="250px" RaisesServerEvent="True" AllowEdit="true" Shortcut="Ctrl+A" Width="280px" NAME="TreeView1" DataSourceID="XmlDataSource1" ImageBaseDirectory ="~/Images/"> <LookNodes> <eo:TreeNode ItemID="_Default" ImageUrl ="00030301" ExpandedImageUrl ="00030302" CollapsedImageUrl ="00030301"> </eo:TreeNode> </LookNodes> </EO:TreeView>
thanks guys, Bhartha
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi, I am glad to hear that you like our product and support. As to expand the node, try to call the following code:
Code: C#
TreeView1.Nodes[0].ExpandPath();
This will expand the first root node only. Thanks!
|
|
Rank: Member Groups: Member
Joined: 4/4/2013 Posts: 10
|
Hi,
Okay, I know that Treeview1.Nodes[0].ExpandPath() would expand the root node. I need the root node expanded as soon as it is rendered. So, where would I put this code. The tree is using a xml file to as a datasource. so, when the page is loaded, it loads the xml contents. Is there an Onload function?
Thanks, Bhartha
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
Try to call TreeView1.DataBind() in your Page_Load, then call the above code after DataBind.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 4/4/2013 Posts: 10
|
Thank you that work. I have a similar question partaining to treeview. I have a context menu attached to the treeview. When a user clicks on the menu item, I want to get the node where he clicked and the item in the menu he clicked. There are two way to it as you had mentioned, servers side onlick event and client side ClientSideOnItemClick. The server side events worked good but, since we have a rather complex page with other controls, to reduce the blicking, have moved to client side. How would I get a handle on the node and menuitem text.
on the server side, this is what I did and accomplished it. EO.Web.TreeNode node = this.TreeView1.ContextNode; ---- get me the node ((EO.Web.MenuItem)e.NavigationItem).Text.ToString() --- got me the text
How do I get these two on the client side please.
Thanks, BHartha
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
|
|
Rank: Member Groups: Member
Joined: 4/4/2013 Posts: 10
|
Thanks, That worked. I got the node path, node text, I can manipulate using these for now. I have a dialog in my page which should show in the client side. I have the following on the client side. this.TreeviewNewRuleDialog.InitialState = EO.Web.DialogState.Visible;
this is throwing an error. Can you guide me here please. Can we render the tree in the client side? I have the following design. A tree being populated by the xml, The tree has a context menu, and when the user clicks on the context menu, I should be able to know which menuitem and node he clicked (Thanks to you I got this now), I should be able to first show him the dialog (my current problem) and then execute the dialog ok button event from the client side and rerender the tree? Possible? reason, I do not want that blicking, this would be smooth.
Thanks, Bharath
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
I do not see any problem with involving the dialog. You can let us know the exception message and we will see what we can find.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 4/4/2013 Posts: 10
|
Here is the message: 0x800a138f - Microsoft JScript runtime error: Unable to get value of the property 'Visible': object is null or undefined
Got this to work using eo_GetObject('Dialog1').show(true); works fine, thanks.
one question. Can we render the tree in the client side (either javascript or some means)? I have the following design. A tree being populated by the xml, The tree has a context menu, and when the user clicks on the context menu, I should be able to know which menuitem and node he clicked (Thanks to you I got this now), I should be able to first show him the dialog (my current problem) and then execute the dialog ok button event from the client side and rerender the tree? Possible? reason, I do not want that blicking, this would be smooth.
Thanks, Bharath
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
No. You can not render the TreeView on the client side. Sorry about that.
Thanks!
|
|