Preserving filter text

3 posts, 1 answers
  1. Riaan
    Riaan avatar
    17 posts
    Member since:
    Jan 2009

    Posted 26 Feb 2009 Link to this post

    Hey there,

    I am listing users in the grid that are part of a domain e.g. Telerik\John.....However, I am finding great difficulty in filtering for values as the user needs to type in two \\ for the search to return correct data. I cannot tel the user to type in two \\ as they would not want that and well, you know users :) So, I tried the onneeddatasource event, onpageload etc to changethe FilterExpression, the problem is, by the time I can access the filterexpression, telerik has already romoved the one \ and it searches for Telerikjohn.

    Please help!!!!

  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 27 Feb 2009 Link to this post

    i Riaan,

    I was also able to replicate the issue on my end. I am not sure why the back slash is getting removed. But i found a work around and here is the code snippet.

    CS:
     public string filterText = String.Empty ; 
        protected void Page_Load(object sender, EventArgs e) 
        { 
            
            foreach (GridFilteringItem filter in RadGrid1.MasterTableView.GetItems(GridItemType.FilteringItem)) 
            { 
                TextBox txtbx = (TextBox)filter["columnUniqueName"].Controls[0]; 
                filterText = txtbx.Text; 
                
            } 
        } 
        protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
        { 
            if (e.CommandName == "Filter"
            { 
                GridFilteringItem filter = (GridFilteringItem)e.Item; 
                TextBox txtbx = (TextBox)filter["columnUniqueName"].Controls[0]; 
                txtbx.Text = filterText; 
     
            } 
        } 



    Just give a try with the above code and see if it helps.

    Regards
    Shinu


  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Riaan
    Riaan avatar
    17 posts
    Member since:
    Jan 2009

    Posted 02 Mar 2009 Link to this post

    Hi Shinu,

    That solved the problem thanks alot!!!!

    Riaan

Back to Top