RadTreeView with textbox - can't select text

2 posts, 0 answers
  1. Scott Bedard
    Scott Bedard avatar
    5 posts
    Member since:
    Jun 2008

    Posted 17 Oct 2008 Link to this post

    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);

    }

    }

    }

  2. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 20 Oct 2008 Link to this post

    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.
Back to Top