Replies
Hi Petrov,
Thanks for your reply and very sorry for late reply.
i have tried your code to keep focus on new row on edit button click , working perfectly.
other issue already tried BeforeExitEditMode event and also works perfectly.
many thanks for your help.i may ask more doubts in near future.
have a nice day..
Thanks
Hi Petrov,
Thanks for your quick response.
As you said , i set a condition in keyup event to validate key enter for "new row" and it's working
but other two doubts what i have been mentioned seems not working properly.
as per sample click on edit button focus is not keeping in new row with edit mode, i tried below code also not working
this.ultraGrid1.ActiveCell = this.ultraGrid1.Rows[0].Cells[0];
ultraGrid1.PerformAction(UltraGridAction.EnterEditMode);
duplicate checking is working in ultraGrid1_BeforeCellDeactivate event in case of tab click but not working in case press enter .
how can i check duplicate and validate while press enter focus is on any cell(validate on press enter key).in my current scenario i have only one cell to enter the value.
i tried below to write in ultraGrid1_BeforeRowDeactivate event but it's not working
private void ultraGrid1_BeforeRowDeactivate(object sender, CancelEventArgs e)
{
// ultraGrid1_BeforeCellDeactivate(sender, e);
if (ultraGrid1.ActiveRow != null)
{
if (ultraGrid1.ActiveRow.AccessibilityObject.Name == "Add Row")
{
bool isDuplicate = CheckDuplicateCell(ultraGrid1.ActiveCell.Column, ultraGrid1.ActiveCell.Text);
if (isDuplicate)
{
MessageBox.Show("Duplicate");
e.Cancel = true;
// We force the end user to add valid value right now and don't validate the user input in BeforeRowUpdate.
ultraGrid1.PerformAction(UltraGridAction.EnterEditMode, false, false);
}
}
}
}
Thanks