2
Answers

How to write code for enter only digits in dropdownlist ?

raja ramesh

raja ramesh

13y
1.3k
1
Hi,
I have written windows application
My requirement is I have to enter only digits in DropdownList, for this I have writter code as following 


private void 
BranchCodeRadDropDownList_KeyPress(object sender, KeyPressEventArgs e)
        {
BranchCodeRadDropDownList.DropDownStyle = RadDropDownStyle.DropDown; 
BranchCodeRadDropDownList.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
      Regex regex = new Regex("^[0-9\b]*$");
                e.Handled= (!regex.IsMatch(e.KeyChar.ToString()));                               }
How to write code for 
enter only digits in dropdownlist  ?
Answers (2)