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
164
Allow the user to edit multiple rows before updating.
posted

My UltraGrid is bound to a DataTable which doesn't allow Null values in some columns. Even though I don't want to allow the user to update the DataTable when there are some errors :

 

  • I don't want the « Can't update cause there is a null value » popup to pop.
  • I want to allow the user to edit, or even add, some other rows
  • I want to highlight the cells with error.

I already got a good idea how I'm going to make the 3rd point happen (Infragistics Documentation) but I have no clues for the first two.

Can anyone point me in the right direction please?

 

  • 48586
    posted

    Hello,

     

    For point one please handle ultraGrid1_CellDataError event and add the following code there:

                e.RestoreOriginalValue = true;//restore the previous value

                e.RaiseErrorEvent = false;//determine if the popup should pop

                e.StayInEditMode = false;// determine if the cell should stay in edit mode

     

    For point two I think that you just should allow add new and allow update (by default the grid is editable). You could allow these properties with

                this.ultraGrid1.DisplayLayout.Override.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.TemplateOnTop;

                this.ultraGrid1.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.True;

                this.ultraGrid1.DisplayLayout.Override.AllowUpdate = Infragistics.Win.DefaultableBoolean.True;

     

     

    Please let me know if you have any further questions.