Custom editor in a grid view - problem with focus

2 posts, 0 answers
  1. Colombatto Luca
    Colombatto Luca avatar
    1 posts
    Member since:
    May 2010

    Posted 21 Sep 2010 Link to this post

    Hi,
    I've start from your demo "Grid view" --> "Use custom editor", to make a simple custom editor based on a textbox and a single button (like BrowseEditorElement)... but I've found a "strange" behaviour also in the BrowseEditorElement!
    I try to explain (still referring to your demo "Grid view" --> "Use custom editor"):
    only using the keyboard to navigate the grid (for example with the Tab key), starting typing in the second column, the customer editor of the cell becomes acitve, but the text just typed doesn't appear in the textbox of this custom control...

    I think that this may be a desided behaviour, in consideration that in the demo the column rapresent a path (not to edit manually).

    Anyway I've found this code that (for my opinion) doesn't work correctly.

     

    public override void BeginEdit()

     

    {

     

    base.BeginEdit();

     

     

    BrowseEditorElement editor = (BrowseEditorElement)this.EditorElement;

     

    editor.TextBox.SelectAll();   // this is completely ignored

    editor.TextBox.Focus();       // this is completely ignored - READING THE RETURN VALUE IT'S "FALSE"

    editor.TextBox.TextChanging +=

    new TextChangingEventHandler(TextBox_TextChanging);

     

    editor.TextBox.TextChanged +=

    new EventHandler(TextBox_TextChanged);

     

    editor.TextBox.KeyDown +=

    new KeyEventHandler(TextBox_KeyDown);

     

    editor.Button.Click +=

    new EventHandler(Button_Click);

     

    }


    Is this is a bug? How can I make my code work correctly?

    Thank you in advance.

    Luca
  2. Alexander
    Admin
    Alexander avatar
    306 posts

    Posted 24 Sep 2010 Link to this post

    Hello Colombatto,

    Thank you for reporting this issue in our examples. Please focus the HostedControl of the RadTextBoxItem:
    editor.TextBox.HostedControl.Focus();

    I have updated your Telerik points for helping us to improve our examples.

    Best regards,
    Alexander
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top