Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
80
XAM Combo Editor - set Selected Item or Seleceted Index
posted

Hii,

I used XamCombo with Multiple columns, with Silverlight 4 and C#

I want to set Selected Index by giving its value run time in Load event.

normally  with other combo Controls we are doing this as,

cmbcategory.text=  "0005" or  cmbcategory.text= defaultvalue 

how can I do this using XAMCombo editor ??

 

 

 

Parents
  • 28407
    posted

    HI,

     Try using the selected Item add method.

     Here is a code snippet

    ObservableCollection<Person> people = new ObservableCollection<Person>();

     

     

     

     Person q = new Person() { ID = 2, Name = "mary" };

     

     

    Person v = new Person() { ID = 3, Name = "Alice" };

     

    "Name";

     

     

    Person p = new Person() { ID = 1, Name = "matt" }; 

     people.Add(p);

    people.Add(q);

    people.Add(v);

    comboEditor.ItemsSource = people;

    comboEditor.DisplayMemberPath =

    comboEditor.SelectedItems.Add(q);

      Sincerely,
     Matt
     Developer Support Engineer

Reply Children