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

Insert new row with tabkey

3 Answers 130 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 03 Sep 2009, 09:03 PM
Hello,

Is it possible to automatically  insert a new row after tabbing out of the last cell of the radgridview?
Furthermore when I press enter after I edit a cell the cell stays in editmode. But after pressing enter in the new row the cell gets out of editmode. My itemssource is an observablecollection.

With kind regards,
Thomas

3 Answers, 1 is accepted

Sort by
0
Nedyalko Nikolov
Telerik team
answered on 07 Sep 2009, 08:43 AM
Hi Thomas,

With the current version of the RadGridView this "Insert on TAB" functionality is not available out of the box. However you can meet your goals with a few lines of code, just handle RadGridView.KeyDown event and check for a TAB press something like that:

void radGridView_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) 
   { 
       if (e.Key == Key.Tab) 
       { 
           this.radGridView.BeginInsert(); 
       } 
   } 

Be aware that this also will work when you traverse backwards (via Shift+TAB).
This is possible because RadGridView handles key down event for TAB key if current cell is changed, in other words when TAB navigation reaches the end (or beginning) this event will not be handled.

For the second problem with Enter key - Can you commit that this happens with the latest build? GridViewCell will stay in edit mode when you hit Enter just in case when its validation fails.

Regards,
Nedyalko Nikolov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Thomas
Top achievements
Rank 1
answered on 11 Sep 2009, 08:32 AM
Hello,

Your example works fine. Thanks.

For the second issue, yes, I use the latest build.

Are you planning to implement more powerful editing capabilities anytime soon?

With kind regards,
Thomas




0
Nedyalko Nikolov
Telerik team
answered on 11 Sep 2009, 01:25 PM
Hi Thomas,

I've managed to simulate this second issue (GridViewCell stays in edit mode after CommitEdit()). It is already fixed and will be available with the latest internal build.

P.S. I've updated your Telerik points accordingly.

Regards,
Nedyalko Nikolov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Thomas
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
Thomas
Top achievements
Rank 1
Share this question
or