Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
225
Retain data of TemplateAddRow without adding the row to the ultragrid.
posted

Hello, 

We have an ultraGrid with a templateAddRow on the top. When we click on a cell a row, we can edit it. In the last column of the TemplateAddRow, we added a button "+". If the user clicks on the button "+" or presses ENTER , the row is added to the grid after validating obligatory fields. Else, the data of templateAddRow is retained.

I tried with this code : 

"private void UltraGridIndexOnBeforeRowUpdate(object sender, CancelableRowEventArgs e)

{

    if (e.Row.IsAddRow && !_canAddRow)
        ultraGridIndex.RowUpdateCancelAction = RowUpdateCancelAction.RetainDataAndActivation;
    else
        ultraGridIndex.RowUpdateCancelAction = RowUpdateCancelAction.CancelUpdate;
    e.Cancel = !_canAddRow;

}

_canAddRow is a boolean which value is true when the button "+" or ENTER is pressed.

This code retains data of TemplateAddRow, but disables editing of the existing rows. 

Any Ideas? 

Thank you in advance.

Parents Reply Children