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
4032
How bind ARGB-value of UltraColorPicker control
posted

Hi all,

I have a dataset-table with column BackColor of type integer and have bound the colorpicker ColorWin32-property to the datasource. It seems that the alpha value gets lost when saving to the database. Choosing color transparent ist restored to color white.

I have tried to bind the colorpicker Color-property instead and to use a datafilter to convert the values. But I get an internal editor converting error:

    InnerException Message: Invalid conversion.
       bei Infragistics.Win.UltraWinEditors.UltraColorPicker.OnValueChanged(EventArgs args)
       bei Infragistics.Win.UltraWinEditors.TextEditorControlBase.OnValueChanged(Object sender, EventArgs args)
       bei Infragistics.Win.EmbeddableEditorBase.RaiseValueChangedEvent()

My datafilter implements to conversions:

 case Infragistics.Win.ConversionDirection.EditorToOwner:
     if ( args.Value == DBNull.Value || args.Value == null || args.Value.Equals( System.DBNull.Value ) )
           return args.Value;

     args.Handled = true;

     Color color = (Color)args.Value;

     // return argb value to tha dataset and to store in db    

     return color.ToArgb();

 case Infragistics.Win.ConversionDirection.OwnerToEditor:
      if ( args.Value == DBNull.Value || args.Value == null || args.Value.Equals( System.DBNull.Value ) )
          return args.Value;

      args.Handled = true;

      // return color class to the bound color-property
      return (Color)args.Value;

Does anybody can point me in the right direction to achieve this.

Regards

Markus