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

Custom editor in a grid view - problem with focus

1 Answer 114 Views
TextBox
This is a migrated thread and some comments may be shown as answers.
Colombatto Luca
Top achievements
Rank 1
Colombatto Luca asked on 21 Sep 2010, 07:43 PM
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

1 Answer, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 24 Sep 2010, 04:29 PM
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
Tags
TextBox
Asked by
Colombatto Luca
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Share this question
or