Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have written a web part that has 3 extra properties that are all related. Right now each has its own title & input field. Is there a way I could make it 1 title with 3 fields?

I was not successful when using a struct for the field.

 Public enum joinType{
       And=0,
       Or
 }

 [WebBrowsable(true), Category("custom"), WebDisplayName("Choice : Part 1"), WebDescription("Title of object"), PersonalizationScope(PersonalizationScope.Shared)]
 Public string myTitle {get; set;}

 [WebBrowsable(true), Category("custom"), WebDisplayName("Choice : Part 2"), WebDescription("Type of object"), PersonalizationScope(PersonalizationScope.Shared)]
 Public joinType myType {get; set;}

 [WebBrowsable(true), Category("custom"), WebDisplayName("Choice : Part 3"), WebDescription("Value of object"), PersonalizationScope(PersonalizationScope.Shared)]
 Public string myTitle {get; set;}
share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

You can do that by making all of these webbrowseable(false) and creating your own editorpart which looks however you want and then when you save the editor part you can assign the webpart properties the appropriate values from your editorpart.

See http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.editorpart.aspx and http://msdn.microsoft.com/en-us/library/hh228018(v=office.14).aspx

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.