This is a migrated thread and some comments may be shown as answers.

Grid data resets after showing/hiding filter row

2 Answers 62 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris LaFrancis
Top achievements
Rank 1
Chris LaFrancis asked on 27 Apr 2010, 04:57 PM
I have 2 image columns whose url's are based on the value of another column and an upper and loer limit that the user can select from a rad window.
The Rad window is called from the rad grid and when it closes it updates the image columns based on the values the user selects.
I also have server side code that shows or hides the filter row. At the end it calls the rebind() method to show or hide the filter row.
My problem is that when it does the rebind I lose the limits the user set as well as the image url's because it goes back to the way it was when it was originally loaded.
What can I do to get the grid to stay the way it was and show or hide the filter row?
Thank you.

Protected Sub GrdPoints_ItemCommand(ByVal source As ObjectByVal e As GridCommandEventArgs) _  
                     Handles GrdPoints.ItemCommand  
 
        If e.CommandName = "PointsFilter" Then 
            If GrdPoints.MasterTableView.AllowFilteringByColumn = False Then 
                GrdPoints.MasterTableView.AllowFilteringByColumn = True 
            Else 
                GrdPoints.MasterTableView.AllowFilteringByColumn = False 
            End If 
            GrdPoints.MasterTableView.Rebind()  
        End If 
    End Sub 

2 Answers, 1 is accepted

Sort by
0
Accepted
Yavor
Telerik team
answered on 30 Apr 2010, 09:05 AM
Hi Chris,

In such a setup, when the control is rebound, the settings which you have applied will be removed.
This behavior is expected.
One possible option in this case, would be to use custom code and logic to handle the filter item visibility.
For example, you can have a hidden input on the page, which will hold a true/false value, indicating whether the filter menu should be shown. Then, in the gridCreated event handler, you can access the hidden input, check its value, and hide/show the filter item accordingly.
I hope this suggestion helps.

Kind regards,
Yavor
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Chris LaFrancis
Top achievements
Rank 1
answered on 03 May 2010, 01:42 PM
Thanks for the response. I will give that a try.
Chris
Tags
Grid
Asked by
Chris LaFrancis
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Chris LaFrancis
Top achievements
Rank 1
Share this question
or