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
300
System.ArgumentException from System.Drawing if grouped view with image in the cell appearance
posted

Hi there,

we use an Infragistics for WinForms 2010.1.

We have an UltraGrid derived Control with 4 grouped columns. The cells of one of this columns has set Appearance.Image property to a dynamically created Bitmap. This happens within an   InitializeRow handler of the grid.

The Bitmap are created like here:

private static Bitmap getAktionsArtImage(MasterData mdAktionsArt)
{
      if (mdAktionsArt != null && mdAktionsArt.Color is Color)
      {
          var c = (Color)mdAktionsArt.Color;
          var img = new Bitmap(16, 16);
          using (Graphics g = Graphics.FromImage(img))
              g.FillRectangle(new SolidBrush(c), 0, 0, 15, 15);
          return img;
      }
      return null;
}

By this constellation we change anything on the DataSource listand get an System.ArgumentException. What can be wrong here? Is this an Infragistics, my or .NET bug?

StackTrace:
bei System.Drawing.Image.get_Width()
bei System.Drawing.Image.get_Size()
bei Infragistics.Win.UltraWinGrid.GroupByRowDescriptionUIElement.PositionImageHelper(UltraGridGroupByRow row, Rectangle& workRect, GroupByRowDescriptionUIElement containerElem, UIElementsCollection oldElements)
bei Infragistics.Win.UltraWinGrid.GroupByRowDescriptionUIElement.PositionChildElements()
bei Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
bei Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
bei Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
bei Infragistics.Win.UltraWinGrid.RowColRegionIntersectionUIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
bei Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
bei Infragistics.Win.UltraWinGrid.DataAreaUIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
bei Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
bei Infragistics.Win.UltraWinGrid.UltraGridUIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
bei Infragistics.Win.UIElement.VerifyChildElements(Boolean recursive)
bei Infragistics.Win.ControlUIElementBase.VerifyIfElementsChanged(Boolean verify, Boolean syncMouseEntered)
bei Infragistics.Win.ControlUIElementBase.get_CurrentCursor()
bei Infragistics.Win.UltraControlBase.get_Cursor()
bei System.Windows.Forms.Control.WmSetCursor(Message& m)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)