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

RadGrid client side show /hide Filter button by default hide

8 Answers 340 Views
Filter
This is a migrated thread and some comments may be shown as answers.
nanthakumar thangavel
Top achievements
Rank 1
nanthakumar thangavel asked on 02 Aug 2010, 07:39 PM
show /hide filter button  working in radgrid on client side when I've to set AllowFilteringByColumn="true"
but i try to  set
 AllowFilteringByColumn="false" in order to default  the grid to not show the filters

I will need to hide filter button defaultly instant of show on client side 

how do i do this? if ll u send me a sample code its very useful to me.

8 Answers, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 05 Aug 2010, 12:54 PM
Hello Nanthakumar,

To achieve the desired functionality you could try calling the hide filter function on OnGridCreated client side event:
<ClientSettings>
   <ClientEvents OnGridCreated="OnGridCreated" />
</ClientSettings>

<telerik:RadCodeBlock runat="server">
    <script type="text/javascript">
      function Hide()
      {
         $find('<%=RadGrid1.ClientID %>').get_masterTableView().hideFilterItem();
      }
      function OnGridCreated(sender, eventArgs)
      {
          Hide();
      }
    </script>
 </telerik:RadCodeBlock>

Please give it try and let me know if it helps you.

Regards,
Radoslav
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
nanthakumar thangavel
Top achievements
Rank 1
answered on 05 Aug 2010, 05:28 PM
its worked  with help of above code..

Thank you very much....

0
Radoslav
Telerik team
answered on 06 Aug 2010, 06:55 AM
Hello Nanthakumar,

I am glad that you achieved the desired functionality.
If you need further assistance, do not hesitate to contact us again.

Kind regards,
Radoslav
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
Andy
Top achievements
Rank 1
answered on 19 Oct 2010, 06:26 PM
Hi!

I try to call the Hide() from VB by using the following code

If (Not ClientScript.IsStartupScriptRegistered("alert")) Then
 
    Page.ClientScript.RegisterStartupScript _
    (Me.GetType(), "Hide", "Hide();", True)
 
End If

But it can't find the RadGrid1 (show "null" when debug).
Need a help, please!

Andy.
0
Radoslav
Telerik team
answered on 22 Oct 2010, 02:19 PM
Hello Andy,

Could you please try using the following code snippets and let me know if the issue still persists:

VB code:
Page.ClientScript.RegisterStartupScript(Me.GetType(), "Hide", "Hide();", True)
JavaScript code:
function Hide()
{
   setTimeout(function ()
   {
      $find('<%=RadGrid1.ClientID %>').get_masterTableView().hideFilterItem();
   }, 200);
}

Best wishes,
Radoslav
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
Andy
Top achievements
Rank 1
answered on 22 Oct 2010, 03:13 PM
Hi Radoslav,

I tried the code but it gave error.
When debugging, I found it can't find the RadGrid1 (value is null)

Andy.
0
Radoslav
Telerik team
answered on 26 Oct 2010, 11:37 AM
Hi Andy,

You could try setting directly the RadGrid1.MasterTableView.IsFilterItemExpanded property to false on the server. For example:
Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
 MyBase.OnLoad(e)
 
 RadGrid1.MasterTableView.IsFilterItemExpanded = False
 
End Sub

Then the filter item will be hidden on client side and you could show it with the following JavaScript code:
$find('<%=RadGrid1.ClientID %>').get_masterTableView().showFilterItem();

Additionally I am sending you a simple example. Please check it out and let me know if it helps you.

Greetings,
Radoslav
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
Sheetal
Top achievements
Rank 1
answered on 17 Oct 2013, 03:57 PM
simple approach would be to set AllowFilteringByColumn property to false
Tags
Filter
Asked by
nanthakumar thangavel
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
nanthakumar thangavel
Top achievements
Rank 1
Andy
Top achievements
Rank 1
Sheetal
Top achievements
Rank 1
Share this question
or