How do I set keyboard focus to the Add Row after adding a row

Answered (Verified) This post has 1 verified answer | 4 Replies | 2 Followers Thread's RSS feed.

DarkIce
Points 145
Replied On: Thu, Aug 9 2012 4:15 AM Reply

I have a XamDataGrid (version 2011.2), when a user has tabbed off of the "Add New" row I need the focus to return to the first cell of the Add New row so they can enter another record, the default behaviour keeps the focus on the record that has just been added.

I have tried to use DataPresenterCommands to move the focus or to find a way to set myGrid.Records.DataPresenter.ActiveCell but haven't had any success.

Does anyone have any ideas?

  • Post Points: 20

Verified Answer

[Infragistics] Yanko
Points 35,314
Infragistics Employee
Answered (Verified) Replied On: Fri, Aug 10 2012 4:13 AM Reply
Verified by DarkIce

Hello,

 

I have been looking into your reply and I am attaching a sample application(DataGridAddNewRecordFocus.zip) which shows the desired functionality. When you fill the new record and press ‘Enter’, the focus returns to the AddNewRecord.

 

Please inform me if I have misunderstood you in any way.

Best regards,
Yanko
Developer Support Engineer
Infragistics, Inc.

  • Post Points: 40

All Replies

[Infragistics] Yanko
Points 35,314
Infragistics Employee
Answered (Not Verified) Replied On: Fri, Aug 10 2012 3:17 AM Reply
Suggested by [Infragistics] Yanko

Hello,

 

I have been looking into your question and I can suggest you look through the following forum thread where Stefan already has provided an approach on how this functionality can be achieved :

 

http://www.infragistics.com/community/forums/p/51065/315199.aspx

 

If you need any further assistance on this matter, feel free to ask.

Best regards,
Yanko
Developer Support Engineer
Infragistics, Inc.

  • Post Points: 20
DarkIce
Points 145
Replied On: Fri, Aug 10 2012 3:58 AM Reply

Thanks for the suggestion, I'd some how missed that during my searches.

I have just tried the code in that post but it does not seem to work, CurrentAddRecord is always null.

  • Post Points: 20
[Infragistics] Yanko
Points 35,314
Infragistics Employee
Answered (Verified) Replied On: Fri, Aug 10 2012 4:13 AM Reply
Verified by DarkIce

Hello,

 

I have been looking into your reply and I am attaching a sample application(DataGridAddNewRecordFocus.zip) which shows the desired functionality. When you fill the new record and press ‘Enter’, the focus returns to the AddNewRecord.

 

Please inform me if I have misunderstood you in any way.

Best regards,
Yanko
Developer Support Engineer
Infragistics, Inc.

  • Post Points: 40
DarkIce
Points 145
Replied On: Fri, Aug 10 2012 4:25 AM Reply

Thanks, that works how I want, just need to work out why it doesn't in my app!

  • Post Points: 5
Page 1 of 1 (5 items) | RSS