Home Forums WinForms controls Xceed Grid for WinForms Hiding and Showing a row

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #14895 |

    Hey, I am trying to have a row that represents the totals of the grid. This row will sit at the top of the grid and can be hidden at any time by the user.

    For some reason I can hide the row, but I can’t make it come back…I am simply updating the row’s visible property, but it never comes back. Any ideas?

    Here is the simple code I have to hide/show the row.

    Public Shared Sub ShowAccountTotals(ByVal grid As GridControl, ByVal show As Boolean)

    Dim totalRow As DataRow = grid.DataRows(0)

    totalRow.Visible = show
    totalRow.EndEdit()
    End Sub

    Imported from legacy forums. Posted by flyingpenguin (had 2380 views)

    User (Old forums)
    Member
    Post count: 23064

    You should use a SummaryRow (or a ValueRow if you prefer to handle the calculation yourself) and add it to the FixedHeaderRows collection of the GridControl. Then you set this row visible property to true of false.

    e.g.:

    Dim totalRow as New ValueRow()
    GridControl1.FixedHeaderRow.Add( totalRow )

    totalRow.Visible = False
    GridControl1.FixedHeaderRows( 2 ).Visible = True

    The index of the valueRow in the FixedHeaderRows will depend of what rows are already in the collection. Normally, there is already the GroupByRow and the ColumnManagerRow present.

    Imported from legacy forums. Posted by André (had 372 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks, that solution worked out much better than the rigmarole I was trying to do.

    David

    Imported from legacy forums. Posted by flyingpenguin (had 3297 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.