2
Answers

How to bind Enum Values to TextBox in Silverlight ?

Vijay

Vijay

11y
1.7k
1

        How to bind Enum Values to TextBox in Silverlight ?
        
        public class Person
        {
                string Name{get;set;}
                Genders Gender { get; set; }
        }

        public enum Genders
        {
                Male=1,
                Female=2,
                Transgender=3
        }

Now my question is , i want to enter Enum values like 1,2...

i tried like,

        private void btnSubmit_Click(object sender, RoutedEventArgs e)
        {
             Person per=new Person();           
            per.Name = txtFname.Text;

            per.Gender = txtGender.Text(Gender);
        }

please let me know how to do?


Answers (2)