in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

FilterBar - Filter stays in effect when grid datasource changes

Last post 03-12-2008 4:07 PM by KGerritsen. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-10-2008 10:25 AM

    FilterBar - Filter stays in effect when grid datasource changes

    The app has several grids, each with the filterbar enabled and several of the grids have either data reloaded as the user changes the date range desired for the data.  If user has entered something in a column's filter and then reloads the data the filter stays in effect for the new data but the column's filterbar text is not visible.  If you out a watch on the column's filter text you can see the text is still there but it is not visible to the user.

    I went through several different apporaches to fixing this all of which included setting the column's filterbar text to empty string before reloading the grid. The only approach I found that worked was setting the filterbar text to empty string after the grid's data was reloaded.  Even this was not a complete solution as sometimes the filter's text is retained after the reload, even after being set to "", sometimes the filter's text is gone.


  • 03-12-2008 4:07 PM In reply to

    Re: FilterBar - Filter stays in effect when grid datasource changes

    I had the same issue.  This was my workaround:

    Public Structure FilterLabel

    Dim GridCondition As String

    Dim GridfileSave As String

    End Structure

    Dim Grid3Filter As FilterLabel

    'Before database refresh:

    C1TrueDBGrid3.SaveLayout(Grid3Filter.GridfileSave)

    'after database refresh:

    C1TrueDBGrid3.LoadLayout(Grid3Filter.GridfileSave)

    'Include the following to get the condition into the variable for use for labels, etc.

    Private Sub Grid3Filter(ByVal sender As System.Object, ByVal e As C1.Win.C1TrueDBGrid.FilterEventArgs) Handles C1TrueDBGrid3.Filter, C1TrueDBGrid3.AfterFilter

    Grid3Filter.GridCondition = e.Condition

    End Sub

     

    Regards,
    Keith

Page 1 of 1 (2 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.