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

Filter items

1 Answer 53 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Anzar
Top achievements
Rank 2
Anzar asked on 20 Sep 2012, 08:48 AM
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

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 24 Sep 2012, 01:00 PM
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.
Tags
Grid
Asked by
Anzar
Top achievements
Rank 2
Answers by
Eyup
Telerik team
Share this question
or