This is a migrated thread and some comments may be shown as answers.

PlusMinus Animation viivble whn no value in the child node

10 Answers 156 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Ragupathi
Top achievements
Rank 1
Ragupathi asked on 26 Jul 2008, 12:18 PM
I am using a Radtreeview in a windows application.I am loading the value for both parent and child node. when  there  is no value in the child node still the Plus symbol is visible. whwn clicked it is invisible.  I dont want that plus minus animation when there is no value.

Please help us in process.

 

10 Answers, 1 is accepted

Sort by
0
Jordan
Telerik team
answered on 28 Jul 2008, 01:31 PM
Hi Ragupathi,

I am not sure that I fully understand what you mean by "when  there  is no value in the child node".
Do you mean when there are no child nodes?
Also how do you do "loading the value for both parent and child node"?
Could you give an example to clarify?

In case you have set the LoadOnDemand property of RadTreeView to true note that you have to set recursively the LoadedOnDemand property of all nodes that have no children to true in order to hide the expand/collapse (plus/minus) button.

All the best,
Jordan
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ragupathi
Top achievements
Rank 1
answered on 28 Jul 2008, 03:27 PM
Hi jordan,

Radtreeview which we have will not know the empty child nodes  at design time. it can be known only at runtime. so it come there as (+/-) symbol  which i dont need


Thanks

ragu
0
Martin Vasilev
Telerik team
answered on 29 Jul 2008, 01:17 PM
Hi Ragupathi,

Thank you for writing.

There is two main scenarios for populating RadTreeView. It depends on LoadOnDemand property. If LoadOnDemand is false, then all nodes are created and RadTreeView automatically adds plus/minus symbol only for nodes that have children ones. If you have set LoadOnDemand = true, then plus/minus symbol is added to all nodes, because RadTreeView loads only visible ones and it doesn't know which of them have children. Children nodes load when the user in clicks on the expand symbol (on demand). You can remove expand symbol in run-time for the certain nodes, that you know they have not children, by setting theirs LoadedOnDemand property to true:
radTreeView1.Nodes[5].LoadedOnDemand = true

If you have other questions, do not hesitate to contact me again.

Greetings,
Martin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Seth
Top achievements
Rank 1
answered on 28 Nov 2011, 05:14 PM
This method is no longer supported.  How do we achieve this with the latest version (2011.3.11.1116) of the toolkit?
0
erwin
Top achievements
Rank 1
Veteran
Iron
answered on 01 Dec 2011, 02:15 AM
Hi Seth,

I use the follwing Code where TreeNodeInfo is a Class where I store amongst other things the number of potential childnodes.

private void softwareRadTreeView_NodeFormatting(object sender, TreeNodeFormattingEventArgs e)
{
    TreeNodeInfo info = e.Node.Tag as TreeNodeInfo;
 
    if (info != null)
    {
        if (info.PotentialChildNodes > 0)
        {
            e.NodeElement.ExpanderElement.Visibility = ElementVisibility.Visible;
        }
        else
        {
            e.NodeElement.ExpanderElement.Visibility = ElementVisibility.Hidden;
        }
    }
}
0
Jack
Telerik team
answered on 01 Dec 2011, 05:08 PM
Hello Seth,

We introduced several new features in RadTreeView since 2008 and some of them caused breaking changes. Yes, we removed the LoadOnDemand property from RadTreeView. You should handle the NodesNeeded event instead. Find more details in our online documentation. There is also an example in our demo application which demonstrates how to use the load on demand feature: TreeView >> Populate with data >> Load on Demand.

Regarding the expand/collapse visibility, you could use the solution provided by Erwin. 

I hope this helps, if you need further assistance, we will be glad to help.

@erwin, thank you for sharing your solution.
 
All the best,
Jack
the Telerik team

Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

0
Seth
Top achievements
Rank 1
answered on 01 Dec 2011, 08:01 PM
Thanks for the sample, I used that to hide the Expander based on Node Level.
0
Jack
Telerik team
answered on 02 Dec 2011, 05:00 PM
Hi Seth, I am glad to hear that this issue is solved now. If you have any additional questions, please do not hesitate to ask.
 
Best wishes,
Jack
the Telerik team

Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

0
Pete
Top achievements
Rank 1
answered on 11 May 2012, 06:52 PM
Hello,
I need this same functionality (remove the '+' icon if no child nodes are present) with the LoadOnDemand properly set to true.  I am using the ajax aspx telerik controls and I can not find the radtreee_formatting event. Has this changed or does this exist with what i'm using? I have the latest and greatest controls from Telerik.
0
Boryana
Telerik team
answered on 15 May 2012, 12:29 PM
Hi Pete,

Thank you for writing.

The current forum thread refers to RadTreeView for WinForms and the information here is not applicable to the technology you are using. I kindly ask you to open a new thread in the ASP.NET AJAX forums where you will receive proper support.

All the best,
Boryana
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Tags
Treeview
Asked by
Ragupathi
Top achievements
Rank 1
Answers by
Jordan
Telerik team
Ragupathi
Top achievements
Rank 1
Martin Vasilev
Telerik team
Seth
Top achievements
Rank 1
erwin
Top achievements
Rank 1
Veteran
Iron
Jack
Telerik team
Pete
Top achievements
Rank 1
Boryana
Telerik team
Share this question
or