DropDownButton, selected item

Dec 21, 2009 at 8:34 AM

Hello,

Has any of you guys who tried out Silvermoon found a way to set a specific item as selected for the DropDownButton ?
I know you can set the Text value quite easy, but I'm interested in setting both text value, and selecting a specific item on the list.

 

Thanks in advance.

Jan 8, 2010 at 10:10 PM

Hi, esix4u.

I have same needs - so I extend DropDownButton in following manner:

 

	public class ExtDropDownButton : DropDownButton
	{
		private MenuItem selectedItem;

		public MenuItem SelectedItem
		{
			get { return selectedItem; }
		}

		protected override void OnItemClicked(object sender, ItemEventArgs e)
		{
			base.OnItemClicked(sender,e);
			selectedItem = e.Item as MenuItem;
		}
	}