We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Cell focus after row add

Thread ID:

Created:

Updated:

Platform:

Replies:

124817 Jul 1,2016 08:32 AM UTC Jul 5,2016 04:12 AM UTC Windows Forms 4
loading
Tags: GridGroupingControl
Michael K
Asked On July 1, 2016 08:32 AM UTC

Hi All :

When I enable add new on Grid Grouping Cell, if I have end edit on the last column, after press enter key, the new record will be place on the last row and the cursor will focus on the last row and last column.
My question is :

How to make the input cursor back to the top row and the first column and then allow user to enter the new record without use the mouse click

Thanks

Michael

Michael K
Replied On July 2, 2016 06:36 AM UTC

Hi :

And one more question, how to get th event of  on Grid Grouping Control after row add

Thanks

Amal Raj Umapathy Selvam [Syncfusion]
Replied On July 4, 2016 12:59 PM UTC

Hi Michael, 

Thanks for using Syncfusion products. 

 
 
 
 
 
 
How to make the input cursor back to the top row and the first column and then allow user to enter the new record without use the mouse click 
In order to set AddNewRecord as current record when enter key is pressed in last column,  CurrentCell.MoveTo() can be used. Please make use of the below code. 

Code Snippet 
//event hookup 
this.gridGroupingControl1.TableControlCurrentCellKeyDown += new Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlKeyEventHandler(gridGroupingControl1_TableControlCurrentCellKeyDown); 

//to set addnewrecord as current cell. 
void gridGroupingControl1_TableControlCurrentCellKeyDown(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlKeyEventArgs e) 
   if (e.Inner.KeyCode == Keys.Enter && e.TableControl.CurrentCell.ColIndex == e.TableControl.TableDescriptor.Columns.Count  
                && e.TableControl.CurrentCell.RowIndex == e.TableControl.Model.RowCount) 
   { 
      e.TableControl.CurrentCell.MoveTo(e.TableControl.TopRowIndex - 1, 1, GridSetCurrentCellOptions.SetFocus, false); 
      e.TableControl.SelectRecords.Clear(); 
   } 
  
 
 
 
 
how to get the event of  on Grid Grouping Control after row add 
The new record added to grid can be identified from SourceListRecordChanged event. Please make use of the below code. 
 
Code Snippet 
//event hookup 
this.gridGroupingControl1.SourceListRecordChanged += new Syncfusion.Grouping.RecordChangedEventHandler(gridGroupingControl1_SourceListRecordChanged); 
 
void gridGroupingControl1_SourceListRecordChanged(object sender, Syncfusion.Grouping.RecordChangedEventArgs e) 
   if (e.Action == RecordChangedType.Added) 
   { 
      //process that needs to be done. 
   } 

Regards, 
Amal Raj U. 


Michael K
Replied On July 4, 2016 02:35 PM UTC

Dear Raj :

Yes. your snippet code is what I need, 

Thanks for your help



Amal Raj Umapathy Selvam [Syncfusion]
Replied On July 5, 2016 04:12 AM UTC

Hi Michael, 

Thanks for your update. 

We are glad to know that the given solution has solved your query. Please let us know, If you need any further assistance. 

Regards, 
Amal Raj U. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;