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

refresh grid

1 Answer 83 Views
Grid
This is a migrated thread and some comments may be shown as answers.
zxp
Top achievements
Rank 1
zxp asked on 07 Jul 2010, 04:50 PM
Hi all,

I have one RadToolBarButton: Show/Hide Filter. When I click the button, I want the Filter disappear or appear. I tried from client side, call RadGrid.MasterViewPage.showFilter/hideFilter(The method name maybe incorrect.). but it has a "flicker": at first it will show up the filter, but then it will disappear. So this make the page a little "flicker".
I tried from server side, when click the show/hide button, trigger the server side button click event. And change the property AllowFilteringByColumn to true or false. But this does not work for the frist and second click. And the RadGrid refreshed but the filter won't appear if I click Show Filter or Hide Fiter. The thrid click will work. I assuming that the RadGrid does not refresh correct. So I call the RadGrid.Rebind() method. But this time, another issue occur,
1) The filter disappear when the page load first.
2) click Show Filter, the filter will appear.
3) input some expression and the result get filtered, which is correct.
4) click Hide Filter, the filter disappear.
5) click the show filter again, The full list is displayed, but the previous filter expression is still in the textbox, which mean the expression does not be applied.

I thought it was because of the ViewState of the RadGrid, but when I disable the ViewState for the RadGrid, I encountered some other issues, which made me believe that the viewState could not be disabled.

How I can get rid of this? Does anyone has a solution for this?
Thanks in advance. Need urgent answer.

1 Answer, 1 is accepted

Sort by
0
zxp
Top achievements
Rank 1
answered on 08 Jul 2010, 05:09 AM
I fixed this by the following code:

For Each gridColumn As GridColumn In EntityGrid.MasterTableView.AutoGeneratedColumns
                    gridColumn.CurrentFilterValue = String.Empty
                Next
                Me.EntityGrid.Rebind()
Tags
Grid
Asked by
zxp
Top achievements
Rank 1
Answers by
zxp
Top achievements
Rank 1
Share this question
or