Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Grid > filter in grid failing to capture special characters < > =

Not answered filter in grid failing to capture special characters < > =

Feed from this thread
  • Minh avatar

    Posted on May 15, 2012 (permalink)

    Hi,

    I'm working w/ the radgrid. The grid has a column that contains special characters such as

    '< 5 MMBtu'
    '>130hp'

    during filtering, the grid will fail to filter any values that contain '>', '<', and '='

    ...I'm using the filter clause 'Contains', 'Starts with', 'Equal to'

    please advise.

    thanks,
    Minh Bui
    Attached files

    Reply

  • Posted on May 16, 2012 (permalink)

    Hello MInh,

    With reference to this forum thread, filtering in RadGrid  with " LIKE ", " AND ", " OR ", "\"", ">", "<", "<>", " NULL ", " IS " and '';" is said to be unsupported.

    Thanks,
    Shinu.

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.
  • Minh avatar

    Posted on May 17, 2012 (permalink)

    Hi,

    I was trying to build a custom filter that will allow me to search for a specified string that contains special characters..I took the example from the online documention....I was hoping that someone would guide me through the rest of the way..

     

     

    protected void GridChevronPortEQ_ItemCommand(object sender, GridCommandEventArgs e)

     

    {

     

     

    if (e.CommandName == RadGrid.FilterCommandName)

     

    {

     

     

    Pair filterPair = (Pair)e.CommandArgument;

     

     

     

    if (filterPair.First.ToString() == "Contains")

     

    {

     

     

    string colName = filterPair.Second.ToString();

     

     

     

    TextBox tbPattern = (e.Item as GridFilteringItem)[colName].Controls[0] as TextBox;

     

     

     

    string[] values = tbPattern.Text.Split(' ');

     

     

     

    if (values.Length == 2)

     

    {

    e.Canceled =

     

    true;

     

     

     

    string newFilter = "(([" + filterPair.Second + "] >='" + values[0] + "') AND ([" + filterPair.Second + "] <='" + values[1] + "'))";

     

     

     

    if (GridChevronPortEQ.MasterTableView.FilterExpression == "")

     

    {

    GridChevronPortEQ.MasterTableView.FilterExpression = newFilter;

    }

     

     

    else

     

    {

    GridChevronPortEQ.MasterTableView.FilterExpression =

     

    "((" + GridChevronPortEQ.MasterTableView.FilterExpression + ") AND (" + newFilter + "))";

     

    }

    GridChevronPortEQ.Rebind();

    }

    }

    }

    }

    Reply

  • Pavlina Pavlina admin's avatar

    Posted on May 22, 2012 (permalink)

    Hello Minh,

    I believe that the forum thread below will help you in resolving this problem:
    http://www.telerik.com/community/forums/aspnet-ajax/grid/grid-mastertableview-filterexpression-is-blank-on-special-chars-like-quot-lt-gt-is-passed-from-google-like-filtering.aspx

    All the best,
    Pavlina
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Grid > filter in grid failing to capture special characters < > =
Related resources for "filter in grid failing to capture special characters < > ="

ASP.NET Grid Features  |  Documentation  |  Demos  |  Step-by-step Tutorial  ]