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

Multiple fields as DisplayMember

2 Answers 91 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Thomas Luck
Top achievements
Rank 1
Thomas Luck asked on 03 Nov 2008, 01:17 PM
Hi everyone,

Is there a way to show more than one field? As far as I can tell 'DisplayMember' only allows one field, but I'd like to display multiple.

I made the same application with RadTree in WebForm and there I could easily change the text in the 'NodeBound' event. I didn't find this in WinForm.

Thanks
Thomas

2 Answers, 1 is accepted

Sort by
0
Thomas Luck
Top achievements
Rank 1
answered on 03 Nov 2008, 03:19 PM
Ik, I now fount the event 'DrawNode' - that I didn't find anywhere in the documentation - which seems to be equvalent to 'NodeBound' in ASP.NET.

But now I have another problem: I want to use different FontStyles in one node. Is that even possible?
0
Nick
Telerik team
answered on 07 Nov 2008, 02:00 PM
Hello Thomas Luck,

Thank you for your questions.

There is no way to add two display members. You can use string concatenation in some cases though.

The DrawNode event is not like NodeBound event, but I am glad that it serves your needs. For instance, you can change the font of the first node in the root list using the following code snippet:

this.radTreeView1.Nodes[0].Font = new Font("Verdana", 10); 

In what situation/case do you want the node to have a different font?

Do not hesitate to write me back if you have further questions.

Sincerely yours,
Nick
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Treeview
Asked by
Thomas Luck
Top achievements
Rank 1
Answers by
Thomas Luck
Top achievements
Rank 1
Nick
Telerik team
Share this question
or