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

RadTreeView with textbox - can't select text

1 Answer 87 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Scott Bedard
Top achievements
Rank 1
Scott Bedard asked on 17 Oct 2008, 07:49 PM
I am using a radtreeview using code behind to generate the nodes. When the user puts the treeview into 'edit' mode I add a text box to the node using the code below.

The problem occurs when a user clicks on a text box. The text box and node seem to get focus. The user cannot use the mouse to select any text in the text box. This is a major pain if the text box has a lot of text and they need to select a large chunk of text and delete it.

The text box is also ignoring the SelectionOnFocus, no text is not being selected on focus.

Can I get some help for these two problems? Both probably stem from the same behavior.  Maybe Z-order could fix this?

internal

 

class NodeCheckboxTemplate : NodeBaseTemplate, ITemplate

 

{

 

public NodeCheckboxTemplate(NodeBuilderContext context, bool editing) : base(context, editing) { }

 

 

public void InstantiateIn(Control container)

 

{

 

var node = (RadTreeNode)container;

 

 

if (IsEditing)

 

{

 

var factTextBoxControl = new RadTextBox

 

{

ID = container.UniqueID +

"RadTextBox",

 

SkinID =

"treeTextBox",

 

Width =

Unit.Pixel(FactGridTemplateBuilder.Width),

 

Text = node.Value,

SelectionOnFocus =

SelectionOnFocus.SelectAll,

 

EnableViewState =

false

 

};

factTextBoxControl.Text = node.Value;

node.Controls.Add(factTextBoxControl);

 

}

 

 

else

 

{

CreateValueLabel(container, node.Value);

}

}

}

1 Answer, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 20 Oct 2008, 03:38 PM
Hi Scott Bedard,

Please try with the latest release - 2008 Q3 Beta and let us know how it goes.

Sincerely yours,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
TreeView
Asked by
Scott Bedard
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Share this question
or