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

Treeview extended with textbox at top

3 Answers 146 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
GJ
Top achievements
Rank 1
GJ asked on 28 Apr 2017, 08:43 AM

Hello, i want to extend functionality of the treeview with a textbox at top for search funtions. I'm trying to make with code similar to this (see below) but Treeview don't have "Item" like TextBox to get the instance. How can i get this functionality?

private static void AddIconToTextBoxElement(RadTextBoxElement textElement, ImagePrimitive icon)

{

    var item = textElement.TextBoxItem;

    textElement.Children.Remove(item);

    icon.SetValue(DockLayoutPanel.DockProperty, Telerik.WinControls.Layouts.Dock.Left);

    var dockPanel = new DockLayoutPanel

    {

        LastChildFill = true

    };     

    dockPanel.Children.Add(icon);

    dockPanel.Children.Add(item);

    textElement.Children.Add(dockPanel);

}

3 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 01 May 2017, 10:44 AM
Hello Jorge, 

Thank you for writing.  

I would recommend you to create a UserControl that contains a RadTextBox docked to the top and a RadTreeView below the text box. Thus, you can achieve the desired layout and implement the custom search functionality that you want.

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Bruce
Top achievements
Rank 2
answered on 22 Jul 2017, 04:08 AM
I know this post is several months old, but for others searching for a solution, here is a KB article that explains how to do what you user wanted, and an example control that will work out of the box. 

http://www.telerik.com/support/kb/winforms/details/search-box
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 24 Jul 2017, 09:48 AM
Hello Bruce, 

Thank you for writing.  

The referred KB article is greatly appreciated. It may be suitable for some custom search scenarios in RadTreeView. I have updated your Telerik points for the community effort.

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Treeview
Asked by
GJ
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Bruce
Top achievements
Rank 2
Share this question
or