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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

TableControlCurrentCellActivated

Thread ID:

Created:

Updated:

Platform:

Replies:

130060 Apr 19,2017 07:56 AM UTC Apr 27,2017 01:54 PM UTC WinForms 7
loading
Tags: GridGroupingControl
Truong
Asked On April 19, 2017 07:56 AM UTC

Hi everyone !

I have a GridGroupingcontrol which have ShowAddNewRecordAfterDetails = true;

A event TableControlCurrentCellActivated when enter column 1 will show a gridlistcontrol below

when I click on column 1, gridlsitcontrol visible , and this Row has light blue black ground which have a pen in row header
when i click up or down button then press enter, it will move right (my event) this row still has light background and does not have NewRecord below , it skill OK , but when input a letter in TextBox ( i have an event textchanged to search data in gridlistcontrol) then press enter , this row is SELECTED and does not move right ( my event , when press enter will move right) and a new Record appear below




What happen when i input letter in TextBox , can i fix it as case one : no selected , no new row appear below, and when i click in column 1 of a row,
that row has ligt blue background ,what happen with that row .

THANK FOR READING AND HELPING ME !!!!





Arulpriya Ramalingam [Syncfusion]
Replied On April 20, 2017 12:55 PM UTC

Hi Truong, 

Thanks for your interest in Syncfusion products. 

We have analyzed your scenario and since the images are broken. From your query, we suspect that you are trying to avoid the adding new record when pressing the Enter key. By default, when the Enter key is pressed in AddNewRecord row after typing the cell value, the new row will be added and the focus will be set to newly added row.  

We have created a simple sample from what we had understood. In that sample, CurrentRecordContextChange event can be used to add the new row when pressing the Enter key only on last column. Please make use of below code and sample, 

Code snippet 
//Event treggering 
this.gridGroupingControl1.CurrentRecordContextChange += new CurrentRecordContextChangeEventHandler(gridGroupingControl1_CurrentRecordContextChange); 
//Event Customization 
private void gridGroupingControl1_CurrentRecordContextChange(object sender, CurrentRecordContextChangeEventArgs e) 
{ 
     int colIndex = this.gridGroupingControl1.TableControl.CurrentCell.ColIndex; 
 
     if (e.Action == Syncfusion.Grouping.CurrentRecordAction.EndEditCalled && e.Table.AddNewRecord.IsCurrent 
         && colIndex != this.gridGroupingControl1.TableControl.TableDescriptor.Columns.Count) 
     { 
         e.Cancel = true; 
     } 
} 

Note 
Please refer to the attached sample and let us know if we missed anything from your customization. Can you please attach the images as zip folder since the images were broken, so that we could able to understand your scenario clearly and which will help us to provide a better solution at the earliest? 
 
 
Please let us know if we misunderstood anything. 

Regards, 
Arulpriya 


Truong
Replied On April 21, 2017 02:19 AM UTC

Thank you for your help, but it is not work well in my case.Click on column one a GridListControl appear.The problem is there is different between two case ( input or not input letters,characters):Case 1 (not input letters) :  press up or down button , selected item will change => press enter : set value of column one = selected item , move to col 2. Case 2 (input letters): input any letter in TextBox of col 1 , press or not press up, down button  => press enter : set value of column one , problem is here ,currentcell is selected and a new record will appear , still in col 1 , does not move to col 2.I want everything do as Case 1. How to do that, and what is mean of a cell which have light blue border.Your sample slove different between two case , but when press enter in col 1 , does not set selected item value on col 1, and i can not click to choose item in left ListView if colindex is not lastest column

Arulpriya Ramalingam [Syncfusion]
Replied On April 21, 2017 12:54 PM UTC

Hi Truong, 
 
Thanks for your update. 
 
Query 
Response 
Case 1 (not input letters) :  press up or down button , selected item will change => press enter : set value of column one = selected item , move to col 2 . 
Case 2 (input letters): input any letter in TextBox of col 1 , press or not press up, down button  => press enter : set value of column one. I want everything do as Case 1.  How to do that, 
We have analyzed your query and modified the sample to perform as case 1. In the customized sample, CurrentRecordContextChange and TableControlCurrentCellActivated events can be used to restrict adding a new record while pressing the Enter key if it is DropDownCell. Please make use of below code and sample, 

//Event treggering 
this.gridGroupingControl1.CurrentRecordContextChange += new CurrentRecordContextChangeEventHandler(gridGroupingControl1_CurrentRecordContextChange); 
//Event Customization 
private void gridGroupingControl1_CurrentRecordContextChange(object sender, CurrentRecordContextChangeEventArgs e) 
{ 
    int colIndex = this.gridGroupingControl1.TableControl.CurrentCell.ColIndex; 
    //To restrict adding a new row 
    if (e.Action == CurrentRecordAction.EndEditCalled && e.Table.AddNewRecord.IsCurrent 
        && allow) 
    { 
        e.Cancel = true; 
    } 
} 
bool allow = false; 
//Event treggering 
this.gridGroupingControl1.TableControlCurrentCellActivated += new GridTableControlEventHandler(gridGroupingControl1_TableControlCurrentCellActivated); 
private void gridGroupingControl1_TableControlCurrentCellActivated(object sender, GridTableControlEventArgs e) 
{ 
    if (e.TableControl.CurrentCell.ColIndex == 2) 
    { 
        e.TableControl.CurrentCell.ShowDropDown(); 
        allow = true; 
    } 
    else if (e.TableControl.CurrentCell.ColIndex != 2) 
        allow = false; 
} 
 
 
what is mean of a cell which have light blue border 
By default, the AddNewRecordRow will not be selected when you click on the AddNewRecordRow cells. So we are little bit unclear with this scenario.  

We suspect that this reported scenario might be happened by any customization regarding selection. Please confirm us, whether if you have any customization regarding selection. If any, please provide us with your customization to analyze this scenario further. 
 
 
 
problem is here currentcell is selected and a new record will appear , still in col 1 , does not move to col 2. 
As you have mentioned that you are using event to move right, we have customized the CurrentCellKeyDown event to move right and at our end it is working properly. We are little bit unclear with this scenario and we suspect that this issue might be occurred by your customization regarding current cell moving. Can you please provide the below details, 
 
  • Provide the screenshots or video of your scenarios in .zip file since the images updated in your previous update were broken.
  • Please provide the sample customization code regarding current cell moving or if possible modify the attached sample.
 
These would be more useful for us to provide the solution at the earliest. 


Regards, 
Arulpriya 


Truong
Replied On April 24, 2017 02:36 AM UTC

Thank you for your helping me !

There are screenshots of my scenarios

Picture 01 , 
no input letters , press down then enter

Picture 02 , input letters , press down then enter

In case 2 (pic 2 ) a new record appear and currentRecord was selected

I want everything happen as case one( picture 1 ) although input or not input letters

Thank you again !
Best Regard !

Attachment: Desktop_7848b27f.zip

Arulpriya Ramalingam [Syncfusion]
Replied On April 24, 2017 11:10 AM UTC

Hi Truong, 

Thanks for your update. 

We could able to understand your scenario from your screenshot. In our last update (4/21/2017), we have provided the solution as per the case 1 to avoid the new record being added when input the text in GridListControl and also in our previous update (4/20/2017), we have provided the solution to restrict the new row being added until enters the values in last column of that AddNewRecordRow.  

Can you please confirm us whether the provided solutions are resolved your scenario or not?. If not, please let us know your requirement clearly with video or if possible, please provide the modified sample which will help us to provide exact solution at the earliest. 

Thanks for your understandings. 
 

Regards, 
Arulpriya 


Truong
Replied On April 26, 2017 09:49 AM UTC

Dear Arulpriya. Thank you for your helpI try as your example , but when allow = true , e.Cancel = true , i can not click on left ListView or GridListControl below CurrentRecord , or Exit button top right cornor.How to avoid AddNewRecordRow  but still allowed click on orther control on that Form, and in picture one , what is mean of highlight record, which have light blue highlight, it can be remove ?Best Regards,Truong

Arulpriya Ramalingam [Syncfusion]
Replied On April 27, 2017 01:54 PM UTC

Hi Truong, 
 
We are able to reproduce the reported scenario and created the separate incident for the reported scenarios for better follow-up under your account. Please follow-up with that incident. 


Regards, 
Arulpriya 


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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

;