Question

I've got a Data Form Web Part in SharePoint 2010 Designer that I'd like to customize so users can filter it on one of the columns. In other words, they'd be able to drop the web part in, then choose "Edit Web Part" from the down arrow, and then in the properties dialog, go to the Miscellaneous tab. There, you'd have a field labeled "Filter:" and the user would enter a text to filter the list used in the web part.

Is this possible? Any example? Thanks.

Was it helpful?

Solution

You would need to create your own subclass the DataFormWebPart. Once that is done, you can expose simple text properties by adding attributes like these to the WebPart property that you wish the user to be able to change.

[WebBrowsable,
WebDisplayName("User name"),
WebDescription("The Full Username"),
Category("SomeCategory"),
Personalizable(PersonalizationScope.Shared)]

However, if you are looking to go for anything more advanced then you will need to look into creating your own custom ToolPart. More detailed instructions are available at: http://www.wictorwilen.se/Post/Web-Part-Properties-part-1-introduction.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top