0

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;}

1 Answer 1

1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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