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

RadToolBarButton Filter

2 Answers 110 Views
Filter
This is a migrated thread and some comments may be shown as answers.
mohamed
Top achievements
Rank 1
mohamed asked on 19 Apr 2011, 06:45 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Pavlina
Telerik team
answered on 22 Apr 2011, 10:14 AM
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.

0
mohamed
Top achievements
Rank 1
answered on 22 Apr 2011, 11:06 AM
Thanks Pavlina
i tried this for two days .
Tags
Filter
Asked by
mohamed
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
mohamed
Top achievements
Rank 1
Share this question
or