Graphics Leak in FlexGrid inherited FlexPivot

Originally Posted 31 March 2017, 11:05 am EST

  • Originally Posted 31 March 2017, 11:05 am EST

    Hi all,
    here I am back with another issue.
    I've attached a slightly modified version of the C1 setup provided CustomUI FlexPivot sample.

    This is the stack error

      in System.Drawing.Image.get_Width()
    in System.Drawing.Image.get_Size()
    in C1.Win.C1FlexGrid.Util.Styles.StyleContext.GetImageRectangle(Style #aE, Rectangle #zA, Image #Ak, #apb #0pb)
    in C1.Win.C1FlexGrid.Util.Styles.StyleContext.#Zpb(Style #aE, Graphics #AA, Rectangle #zA, Image #Ak, #apb #0pb)
    in C1.Win.C1FlexGrid.Util.Styles.StyleContext.#Zpb(Style #aE, Graphics #AA, Rectangle #zA, Image #Ak)
    in C1.Win.C1FlexGrid.Util.Styles.StyleContext.#Ypb(Style #aE, Graphics #AA, Rectangle #zA, String #gM, String #yxd, Int32 #xEu, Image #Ak)
    in C1.Win.C1FlexGrid.Util.Styles.StyleContext.Render(Style #aE, Graphics #AA, Rectangle #zA, String #gM, String #yxd, Int32 #xEu, Image #Ak, #spb #pC)
    in C1.Win.C1FlexGrid.C1FlexGridBase.#idb(Graphics #AA, Int32 #j, Int32 #l, Style #aE, Rectangle #o5, String #gM, String #yxd, Int32 #xEu, Image #Ak, DrawCellFlags #pC)
    in C1.Win.C1FlexGrid.C1FlexGridBase.DrawCellBase(Graphics #AA, Int32 #j, Int32 #l, Style #aE, Rectangle #o5, String #gM, String #yxd, Int32 #xEu, Image #Ak, DrawCellFlags #pC)
    in C1.Win.C1FlexGrid.OwnerDrawCellEventArgs.DrawCell(DrawCellFlags flags)
    in C1.Win.C1FlexGrid.C1FlexGridRenderer.OnDrawCell(C1FlexGridBase flex, OwnerDrawCellEventArgs e, CellType cellType)
    in C1.Win.C1FlexGrid.GridRendererOffice2007.OnDrawCell(C1FlexGridBase flex, OwnerDrawCellEventArgs e, CellType cellType)
    in C1.Win.C1FlexGrid.C1FlexGridRenderer.OnDrawCell(C1FlexGridBase flex, OwnerDrawCellEventArgs e)
    in C1.Win.C1FlexGrid.C1FlexGridBase.#gdb(OwnerDrawCellEventArgs #tQ)
    in C1.Win.C1FlexGrid.C1FlexGridBase.#fdb(Graphics #AA, Int32 #j, Int32 #l, Style #aE, Rectangle #o5, String #gM, String #yxd, Int32 #xEu, Image #Ak)
    in C1.Win.C1FlexGrid.C1FlexGridBase.DrawCell(Graphics #AA, Int32 #j, Int32 #l, Style #aE, Rectangle #o5, String #gM, String #yxd, Int32 #xEu, Image #Ak, CheckEnum #bdb)
    in C1.Win.C1FlexGrid.C1FlexGrid.DrawCell(PaintEventArgs e, Int32 row, Int32 col)
    in C1.Win.C1FlexGrid.C1FlexGrid.DrawRow(PaintEventArgs e, Int32 row)
    in C1.Win.C1FlexGrid.C1FlexGridBase.#adb(PaintEventArgs #tQ)
    in C1.Win.C1FlexGrid.C1FlexGridBase.OnPaint(PaintEventArgs e)
    in System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
    in System.Windows.Forms.Control.WmPaint(Message& m)
    in System.Windows.Forms.Control.WndProc(Message& m)
    in C1.Win.C1FlexGrid.Util.BaseControls.ScrollableControl.WndProc(Message& m)
    in System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    in System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    in System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


    and here how to follow the steps to reproduce (note that i've simulated my quite real app situation & forms stack):

    1) Run the program
    2) It will appear a naked form with 1 button, press it and another form will appear
    3) A ribbon form appears with a prebuild pivot data (It is a modified version of your code.)
    4) just press the ribbongroup toggle button named "Grand Totals" (it will set the pivot to
    c1FlexPivotPanel1.ShowTotalsRows = ShowTotals.GrandTotals
    and pivot has correctly changed
    5) Now press the toggle button below, names "subTotals": it does the
    c1FlexPivotPanel1.ShowTotalsRows = ShowTotals.Subtotals
    correctly
    6) Now exit the form
    7) You see the first form with the single button: press it once again
    8) redo point 4) and then point 5)
    9) CRASH !






    SPOILER:
    Note that if i remove "XP Styles" form project, everything goes ok!

    Hope this helps too, i've lost the whole work day to reproduce this bug...

    Regards,
    Fabio
    2017/03/CustomUI-MODIFIED.zip
  • Reply

    P.S. Nota that without "Use X Settings", C1TaskDialog will raise an error on .Show when:

    Imports C1.Win.C1Win7Pack

    Private C1taskTemp As C1TaskDialog

    ...

    Private Sub test()
    C1taskTemp = New C1TaskDialog
    With C1taskTemp
    .MainCommonIcon = TaskDialogCommonIcon.Information
    .WindowTitle = "something"
    .MainInstruction = "something"
    .FooterCommonIcon = TaskDialogCommonIcon.ShieldWarning
    .FooterText = something"
    .CommonButtons = TaskDialogCommonButtons.Ok Or TaskDialogCommonButtons.Cancel
    With .RadioButtons
    .Clear()
    .Add(New C1RadioButton With {.Text = "something", .Name = "I"})
    .Add(New C1RadioButton With {.Text = "something", .Name = "S"})
    .Add(New C1RadioButton With {.Text = "something", .Name = "T"})
    End With
    End With
    End Sub

    C1taskTemp.Show()


    End Sub
  • Reply

    Hello Fabio,

    Thanks for sharing the full stack trace and also for sharing the steps to reproduce.
    We could observe the issue and the same has been escalated to the concerned team as Bug {Tracking Id: 252439}.
    I will update you once it is fixed.

    Thanks & regards
    Ruchir Agarwal
  • Reply

    Hi,

    Your issues are fixed in the latest builds that can be downloaded from the links given below:
    http://prerelease.componentone.com/hotfixes/dotnet/C1WinForms.2_2.0.20171.261.zip
    http://prerelease.componentone.com/hotfixes/dotnet/C1WinForms.4_4.0.20171.261.zip

    Thanks,
    Ruchir Agarwal
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels