Vijay

Vijay

  • NA
  • 150
  • 90.8k

How to bind Enum Values to TextBox in Silverlight ?

Sep 4 2013 5:56 AM

        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)