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

Enter editmode on grid on added row from datamodel

4 Answers 74 Views
GridView
This is a migrated thread and some comments may be shown as answers.
morten
Top achievements
Rank 1
morten asked on 25 Oct 2010, 11:25 AM
We're adding our new rows from our datamodel using a shortcut keyboard command. Now I want the newly added row to be in editmode and selected with keyboard focus so I can just start typing.

I've gotten things to work the first time a row is added, however when I add any row after that using just the keyboard. The editmode wont release from the first row. The CurrentItem property wont update. I've tried doing canceleditmode commitedit setting current item etc. before selecting the new row and doing "beginEdit" however the edit will still be stuck at the first row.

Here is an example of what I've done in my event that is fired when I add a new row:
datamodel.AddedRow += delegate
                        {
                             
                            Grid.CommitEdit();
                            Grid.CancelEdit();
                             
                             
                            Grid.UnselectAll();
                            if(!Grid.IsKeyboardFocused)
                                Grid.Focus();
                             
                            Grid.CurrentItem = datamodel.Selected[0];
                             
                            Grid.SetIsCurrent( datamodel.Selected[0], true );
                            Grid.BeginEdit();
                        };

I'm doing more here than I need I know this, but I cannot get it to update the CurrentItem before I do BeginEdit.

I tried the beta version of the Q3 release and it is working there, but I'm wondering if I can get this to work with the released Q2 release.

I can force the behviour to work be using the Rebind method before I set focus and current item. However this comes with a severe performance hit.

4 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 25 Oct 2010, 03:48 PM
Hi morten,

Can you please try with the latest internal build from the last Friday - version 2010.2.1022.

Regards,
Veselin Vasilev
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
0
morten
Top achievements
Rank 1
answered on 26 Oct 2010, 08:21 AM
Trying it now.
0
morten
Top achievements
Rank 1
answered on 26 Oct 2010, 08:40 AM
No, sorry same behaviour with the latest internal build.
0
Veselin Vasilev
Telerik team
answered on 29 Oct 2010, 09:03 AM
Hello morten,

That is strange. Can you please send us a sample project in a new support ticket so we can test it locally?

Thank you

Best wishes,
Veselin Vasilev
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
GridView
Asked by
morten
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
morten
Top achievements
Rank 1
Share this question
or