Filter items

2 posts, 0 answers
  1. Anzar
    Anzar avatar
    62 posts
    Member since:
    Sep 2012

    Posted 20 Sep 2012 Link to this post

    Hi  ,

    My code is below.

      protected void rgDocumentType_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
     {
       TextBox tbFilter=null;
                    AjaxControlToolkit.FilteredTextBoxExtender ftExtender;
                    if (e.Item is GridFilteringItem)
                    {
                        GridFilteringItem fItem = (GridFilteringItem)e.Item;
                        foreach (GridColumn col in rgDocumentType.MasterTableView.Columns)
                        {
                            
                        
                            if (Convert.ToString(col.UniqueName).Equals("colIsModified") == false && Convert.ToString(col.UniqueName).Equals("colActive") == false && Convert.ToString(col.UniqueName).Equals("colCONCUR_ID") == false && Convert.ToString(col.UniqueName).Equals("colRemark") == false)
                            {
                                
                                  tbFilter  = fItem[col.UniqueName].Controls[0] as TextBox;
                                  tbFilter.ID = col.UniqueName;
                                  ftExtender = new AjaxControlToolkit.FilteredTextBoxExtender();
                                   ftExtender.TargetControlID = tbFilter.ID;
                                   ftExtender.FilterMode = AjaxControlToolkit.FilterModes.InvalidChars;
                                   ftExtender.FilterType=AjaxControlToolkit.FilterTypes.Custom|AjaxControlToolkit.FilterTypes.Numbers|AjaxControlToolkit.FilterTypes.LowercaseLetters | AjaxControlToolkit.FilterTypes.UppercaseLetters;
                                   ftExtender.InvalidChars = @"%!&;`'\|*?~<>^()[]{}$&quot;";
                                   tbFilter.Controls.Add(ftExtender);

                                   col.CurrentFilterFunction = GridKnownFunction.Contains;
                                   col.AutoPostBackOnFilter = true;

                                  
                                  
                                   ftExtender = null;
                                   tbFilter = null;
                                

                                                          
                            }
                           
                        }
                    } 


    }

    This code is used for blocking some special characters in the filter textbox Also prevent pasting.
    I set the current filter function here But when clicking on the filter menu button it does not work?

    Thanks & Regards
    Anzar.M
  2. Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 24 Sep 2012 Link to this post

    Hello Anzar,

    I suggest that we continue our conversation on the following thread to enable other users with similar issues to track more easily the discussion:
    http://www.telerik.com/community/forums/aspnet-ajax/grid/current-filter-function.aspx

    Greetings,
    Eyup
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top