RadGrid client side show /hide Filter button by default hide

9 posts, 0 answers
  1. nanthakumar thangavel
    nanthakumar thangavel avatar
    27 posts
    Member since:
    Nov 2009

    Posted 02 Aug 2010 Link to this post

    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.
  2. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 05 Aug 2010 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. nanthakumar thangavel
    nanthakumar thangavel avatar
    27 posts
    Member since:
    Nov 2009

    Posted 05 Aug 2010 Link to this post

    its worked  with help of above code..

    Thank you very much....

  5. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 06 Aug 2010 Link to this post

    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
  6. Andy
    Andy avatar
    107 posts
    Member since:
    Sep 2010

    Posted 19 Oct 2010 Link to this post

    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.
  7. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 22 Oct 2010 Link to this post

    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
  8. Andy
    Andy avatar
    107 posts
    Member since:
    Sep 2010

    Posted 22 Oct 2010 Link to this post

    Hi Radoslav,

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

    Andy.
  9. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 26 Oct 2010 Link to this post

    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
  10. Sheetal
    Sheetal avatar
    5 posts
    Member since:
    Oct 2013

    Posted 17 Oct 2013 Link to this post

    simple approach would be to set AllowFilteringByColumn property to false
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017