Flexgrid dont draw the content when contains a sum footer

Posted by: santer.p75 on 21 December 2024, 12:50 pm EST

    • Post Options:
    • Link

    Posted 21 December 2024, 12:50 pm EST - Updated 21 December 2024, 12:55 pm EST

    Hi,

    i have problems display the content of the flex grid when contains a sum footer . (Flexgrid 4.8.20242.688)

    See the sample project…

    Test Flexgrid.zip

  • Posted 23 December 2024, 7:19 am EST

    Hi,

    I took a look at your sample and have no idea why it does not work :wink: - it is up to the Mescuis support to comment on this.

    But as a workaround: instead of setting the footer during “InitializeComponent”, you could set it after filling the grid like this:

      Private Sub AddRows()
    
        grd.Redraw = False
        grd.Rows.Count = 1
    
        For n As Integer = 1 To 2000
          grd.AddItem("")
          grd(n, 0) = n
        Next
        grd.Redraw = True
    
        Dim FooterDescription1 As C1.Win.C1FlexGrid.FooterDescription = New C1.Win.C1FlexGrid.FooterDescription()
        Dim AggregateDefinition1 As C1.Win.C1FlexGrid.AggregateDefinition = New C1.Win.C1FlexGrid.AggregateDefinition()
        AggregateDefinition1.Aggregate = C1.Win.C1FlexGrid.AggregateEnum.Sum
        AggregateDefinition1.Column = 0
        FooterDescription1.Aggregates.Add(AggregateDefinition1)
        Me.grd.Footers.Descriptions.Add(FooterDescription1)
        Me.grd.Footers.Fixed = True
      End Sub

    After this change, the footer worked for me.

    Hope this helps

    Wolfgang

  • Posted 23 December 2024, 8:07 am EST

    Hi Peter,

    Since a footer row is already set in the designer, setting the row count to 1 does not seem logical. We recommend either commenting out the line of code that sets the row count in the designer or updating it to 2 (to account for both header and footer rows) for proper functionality. Please refer to the following code snippet for guidance:

    Private Sub AddRows()
      grd.Redraw = False
          'grd.Rows.Count = 2
          For n As Integer = 1 To 2000
              grd.AddItem("")
              grd(n, 0) = n
          Next
          grd.Redraw = True
      End Sub

    We have attached the updated sample for reference. Please check Test Flexgrid_Upd.zip

    As workaround, you can also follow the approach suggested by Wolfgang.

    PS: Thanks, Wolfgang, for looking into this issue.

    Kind Regards,

    Aastha

  • Posted 30 December 2024, 4:34 am EST

    Thank you Wolfgang and Aastha,

    this works!

Need extra support?

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

Learn More

Forum Channels