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
130
Overriding a data cell error
posted

Hi all, 

 

I am now using a Ultragrid to create a time schedule and make some data validation in the design view of the ultragrid. And now I would like to use a self-defined Error prompt instead of the  datagrid default one,

I have already applied a CellDataError exception handler on it, but still, the datagrid default one still appear so that the system prompt my self defined error first and comes with the datagrid default one.

Can I disable/Override the default one?

Thanks,

Brian

Parents
  • 20872
    Suggested Answer
    Offline posted

    Hello Brian,

    If I understood correctly your scenario there are two possible approaches here that you could try in order to avoid this message to appear:

    1. You could set the RaiseErrorEvent to False, which will prevent the message to appear as well as preventing the Error event to fire like:

            private void ultraGrid1_CellDataError(object sender, Infragistics.Win.UltraWinGrid.CellDataErrorEventArgs e)
            {
               e.RaiseErrorEvent = false;
            }

    2. You could leave the RaiseErrorEvent setting to its Default value(which is true) and still allow the Error event to fire, because you could use the event args of the Error event to get some useful information like: the Source of the error, ErrorType, ErrorInfo, and once you have the needed details to cancel the event through its event args like:

             private void ultraGrid1_Error(object sender, Infragistics.Win.UltraWinGrid.ErrorEventArgs e)
            {
                e.Cancel = true;
              //e.DataErrorInfo
              //e.ErrorText
              //e.ErrorType
            }

    Please feel free to let me know If I misunderstood you or if you have any other questions with this matter.

Reply Children