I am trying to create a custom ajax filter using code, so far i can filter the textbox with either LowerCaseLetters, or UpperCase etc. but not all 3 and some custom chars. My code at the moment is ;
AjaxControlToolkit.FilteredTextBoxExtender Filter = new AjaxControlToolkit.FilteredTextBoxExtender();
Filter.ID = "Filter" + i.ToString();
Filter.TargetControlID = "NameBox" + i.ToString();
Filter.FilterType = AjaxControlToolkit.FilterTypes.LowercaseLetters;
Filter.FilterType = AjaxControlToolkit.FilterTypes.UppercaseLetters;
Filter.FilterType = AjaxControlToolkit.FilterTypes.Custom;
Filter.ValidChars = " ";
Page.Controls.Add(Filter);
How do you use more than one filter in dynamic filters? thanks John
Hi,
You can use or operator to apply more than one FilterType simultaneously. For example:
Filter.FilterType = Filter.FilterType | AjaxControlToolkit.FilterTypes.LowercaseLetters;
Filter.FilterType = Filter.FilterType | AjaxControlToolkit.FilterTypes.UppercaseLetters;
Filter.FilterType = Filter.FilterType | AjaxControlToolkit.FilterTypes.Custom;
Like this:
Filter.FilterType = AjaxControlToolkit.FilterTypes.Numbers | AjaxControlToolkit.FilterTypes.Custom;
Filter.ValidChars = ".";
No comments:
Post a Comment