RadToolBarButton Filter

3 posts, 1 answers
  1. mohamed
    mohamed avatar
    311 posts
    Member since:
    Mar 2011

    Posted 19 Apr 2011 Link to this post

    In My Form RadToolBarButton i have fix the


    . i want to take two operation in  this fillter command
    show and hide filter in one button

    function showFilterItem() {
                    $find('<%=RadGrid1.ClientID %>').get_masterTableView().showFilterItem()
                }
                function hideFilterItem(checked, eventArqs) {
                    $find('<%=RadGrid1.ClientID %>').get_masterTableView().hideFilterItem();
                }
                function onToolBarClientButtonClicking(sender, args) {
                    debugger;
                    var comandName = args.get_item().get_commandName();
                    if (comandName == "Filter") {
                        hideFilterItem();
                    }
                    else if (comandName == "Filter1") {
                        showFilterItem();
                    }
                }

     <telerik:RadToolBar ID="RadToolBar1" runat="server" OnClientButtonClicking="onToolBarClientButtonClicking">
                            <Items>
                                <telerik:RadToolBarButton  Text="Filter" CommandName="Filter" ImageUrl="../../images/appfiltering.png">
                                </telerik:RadToolBarButton>
                                <telerik:RadToolBarButton Text="Print" CommandName="Print" onclick="PrintRadGrid()">
                                </telerik:RadToolBarButton>
                                <telerik:RadToolBarButton Text="Refresh" CommandName="RebindGrid" ImageUrl="../../images/Refresh.gif">
                                </telerik:RadToolBarButton>
                            </Items>
                        </telerik:RadToolBar>
  2. Answer
    Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 22 Apr 2011 Link to this post

    Hello Mohamed,

    You can attach a client handler to the RadToolBarButton 's OnClientButtonClicking event and use the showFilterItem()/hideFilterItem() client api of the client GridTableView object:
    Javascript:
    function onToolBarClientButtonClicking() 
    {            
        var grid = $find("<%=RadGrid1.ClientID %>");
        if (grid.get_masterTableView().get_isFilterItemVisible()) 
        {
            grid.get_masterTableView().hideFilterItem();
        }
        else
        {
            grid.get_masterTableView().showFilterItem();
        }
      
      
    }

    I hope this information helps.

    All the best,
    Pavlina
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. mohamed
    mohamed avatar
    311 posts
    Member since:
    Mar 2011

    Posted 22 Apr 2011 Link to this post

    Thanks Pavlina
    i tried this for two days .
Back to Top