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

Cancel filtering client side

1 Answer 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
OPL
Top achievements
Rank 1
OPL asked on 28 Dec 2010, 10:01 AM
Hi everybody and merry christmas !

I'm trying to cancel filtering client side on the "oncommand" client event.

It's Ok when i just lostfocus on the textbox filter but if i press enter key the event is not cancel.

js function :

function RadGrid1_Command(sender, eventArgs) {
 
        if (eventArgs.get_commandName() == "Sort" || eventArgs.get_commandName() == "Page" || eventArgs.get_commandName() == "PageSize" || eventArgs.get_commandName() == "Filter" ) {
            if (confirm("blablabmlablabla")) {
                eventArgs.set_cancel(true);
            }else{ ....}
        }
  }

Client setting :

<ClientSettings>
    <ClientEvents OnCommand="RadGrid1_Command" />
</ClientSettings>

Filter column :
<telerik:GridTemplateColumn HeaderText="Libellé"
                   SortExpression="LIBRED"
                   DataField="LIBRED"                            
                   AutoPostBackOnFilter="true"
                   CurrentFilterFunction="Contains"
                   ShowFilterIcon="false"
                   UniqueName="LIBRED">
                 <ItemTemplate>
                     <asp:Label ID="LibelleLbl" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "LIBRED")%>' />
                   </ItemTemplate>
</telerik:GridTemplateColumn>

Thanks.

OPL



1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 31 Dec 2010, 10:43 AM
Hello OPL,

I'm unable to reproduce the problem in my local tests. Please download the attached demo and let me know whether it behaves as expected.

Regards,
Daniel
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.
Tags
Grid
Asked by
OPL
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or