Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Drop-down list in web part properties pane

  Asked By: Garret    Date: Nov 17    Category: Sharepoint    Views: 12521

does anyone have code or an example of how to add a drop-down list
to the properties pane of a web part (in vb)? It seems that the
Microsoft documentation is down and the few articles I've found aren't
very helpful.



4 Answers Found

Answer #1    Answered By: Tyron Calderon     Answered On: Nov 17

You'll want to look at using an enum property. I'm totally offline and have no
SharePoint access right now. If that doesn't get you going, post again.

Answer #2    Answered By: Irvin Foley     Answered On: Nov 17

I know to use the enum property, but am
basically clueless as how to acutally implement it. Do I create a new
class? Any tips or guidance would be most helpful.

Answer #3    Answered By: Deonte Stein     Answered On: Nov 17

Here is the code  I have so far. It gives me the "Windows SharePoint
Services cannot deserialize the web  Part" error. What else do I need
to add  to my project file for this to create a dropdown list  in the
properties pane?

Private colorPicked As MyColors

Public Enum MyColors
Red = 0
Blue = 1
Green = 2
End Enum

<Browsable(True), Category("Select Color"), DefaultValue(""), _
WebPartStorage(Storage.Shared), FriendlyName("Color"), _
Description("")> _
Property BorderStyle() As MyColors
Return colorPicked
End Get
Set(ByVal Value As MyColors)
colorPicked = Value
End Set
End Property

Answer #4    Answered By: Stephon Valentine     Answered On: Nov 17

Check out the following link. Hopefully you can find answers for your question.


Didn't find what you were looking for? Find more on Drop-down list in web part properties pane Or get search suggestion and latest updates.