filter is not working properly?

2 posts, 0 answers
  1. ajmal
    ajmal avatar
    57 posts
    Member since:
    Oct 2006

    Posted 25 Nov 2010 Link to this post

    Hello All,

    I am using telerik in buit filter functionality with only below code in HTML, but filter is not working when apply new search.
    Kindly check attached grid for question explanation.

    to limit filter creteria, below the JS,

    var

     

    column = null;

     

     

    function MenuShowing(sender, args) {

     

     

    if (column == null)

     

     

    return;

     

     

    var menu = sender;

     

     

    var items = menu.get_items();

     

     

    if (column.get_dataType() == "System.String") {

     

     

    var i = 0;

     

     

    while (i < items.get_count()) {

     

     

    if (!(items.getItem(i).get_value() in { 'NoFilter': '', 'Contains': '', 'DoesNotContain': '', 'StartsWith': '', 'EndsWith': '', 'NotEqualTo': '', 'EqualTo': '' })) {

     

     

    var item = items.getItem(i);

     

     

    if (item != null)

     

    item.set_visible(

    false);

     

    }

     

    else {

     

     

    var item = items.getItem(i);

     

     

    if (item != null)

     

    item.set_visible(

    true);

     

    }

    i++;

    }

    }

     

    if (column.get_dataType() == "System.Int64") {

     

     

    var j = 0;

     

     

    while (j < items.get_count()) {

     

     

    if (!(items.getItem(j).get_value() in { 'NoFilter': '', 'GreaterThan': '', 'LessThan': '', 'NotEqualTo': '', 'EqualTo': '', 'Contains': '', 'DoesNotContain': '', 'StartsWith': '', 'EndsWith': '' })) {

     

     

    var item = items.getItem(j);

     

     

    if (item != null)

     

    item.set_visible(

    false);

     

    }

     

    else {

     

     

    var item = items.getItem(j);

     

     

    if (item != null)

     

    item.set_visible(

    true);

     

    }

    j++;

    }

    }

     

    if (column.get_dataType() == "System.Boolean") {

     

     

    var j = 0;

     

     

    while (j < items.get_count()) {

     

     

    if (!(items.getItem(j).get_value() in { 'NoFilter': '', 'EqualTo': '' })) {

     

     

    var item = items.getItem(j);

     

     

    if (item != null)

     

    item.set_visible(

    false);

     

    }

     

    else {

     

     

    var item = items.getItem(j);

     

     

    if (item != null)

     

    item.set_visible(

    true);

     

    }

    j++;

    }

    }

    column =

    null;

     

    }

     

    function filterMenuShowing(sender, eventArgs) {

     

    column = eventArgs.get_column();

    }



    And the Grid is below,


     

    <telerik:RadGrid runat="server" Width="580px" Height="350px" Style="margin: 7px 0px 0px 7px;"

     

     

    ID="grdDelegation" AutoGenerateColumns="False" AllowPaging="True" GridLines="None"

     

     

    PageSize="5" AllowFilteringByColumn="true"

     



    <

     

    ClientSettings EnablePostBackOnRowClick="true" AllowColumnsReorder="True" ReorderColumnsOnClient="True">

     

     

    <Selecting AllowRowSelect="True" />

     

     

    <ClientEvents OnFilterMenuShowing="filterMenuShowing" />

     

     

    </ClientSettings>

     

     

    <GroupingSettings CaseSensitive="false" />

     

     

    <FilterMenu OnClientShown="MenuShowing" />

     

     

    <HeaderStyle Font-Bold="true" HorizontalAlign="Center" />

     



  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 29 Nov 2010 Link to this post

    Hello Ajmal,

    The provided code looks ok to me.
    As the provided information is not enough to isolate the root cause of the issue you are facing, please prepare a simple, fully runnable reproduction demo, open a new support ticket and send it to us along with very detailed reproduction steps and explanations and we will debug it locally and we will do our best to help.



    Kind regards,
    Maria Ilieva
    the Telerik team
    Browse the vast support resources we have to jumpstart 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
Back to Top