Welcome Guest Search | Active Topics | Members | Log In | Register

How to set multiselectvalues in dropdown Options
unp100
Posted: Thursday, July 22, 2010 6:02:48 PM
Rank: Active Member

Joined: 7/20/2010
Posts: 13
Points: 39
Location: usa

How can we set the multiselectvalues in dropdown list.

Thanks
ben
Posted: Thursday, July 22, 2010 6:07:19 PM
Rank: Active Member

Joined: 6/10/2009
Posts: 16
Points: 48
Location: Virginia
You can add items the same way you add items to a single select list. Just set 'MultiSelect' to 'true' on the control.


EntreeDrownList ddl = lGrp.AddFormItem<EntreeDropDownList>(p.Name);
ddl.Name = "name";
ddl.MultiSelect = true;
ddl.Items.Add("key","value");
unp100
Posted: Thursday, July 22, 2010 6:13:18 PM
Rank: Active Member

Joined: 7/20/2010
Posts: 13
Points: 39
Location: usa
I want to show the multiple selected items in dropdown.

I couldnt able to set the value of Multipleselectvalues property as this property is read only.

ben
Posted: Thursday, July 22, 2010 6:18:16 PM
Rank: Active Member

Joined: 6/10/2009
Posts: 16
Points: 48
Location: Virginia
OK, I misunderstood the question.

There is an overload of EntreeDropDownList.Items.Add that takes and EntreeChoice.EntreeChoiceListItem as the parameter. EntreeChoice.EntreeChoiceListItem has a constructor that takes a boolean value that sets if the item is selected. This is how you can set the selected values.

ddl.Items.Add(new EntreeChoice.EntreeChoiceListItem("1", "1", true));
unp100
Posted: Friday, July 23, 2010 9:20:42 AM
Rank: Active Member

Joined: 7/20/2010
Posts: 13
Points: 39
Location: usa
Thanks It worked
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.