//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;
}
} |
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,
These would be more useful for us to provide the solution at the earliest. |