IMPORTANT: This version of Sitefinity CMS is out of support and the respective product documentation is no longer maintained and can be outdated. Use the version selector to view a supported product version.
As the RelatedDataField is using different controls to display related items in backend and widgets in the frontend, you can configure the related data field to use a custom widget for both. In order to change the frontend widget with a custom one, do one of the following:
Register the custom widget via full type name If you choose this approach, the custom widget you create must inherit from SimpleView and IRelatedDataView. You also must override the LayoutTemplatePath. You have access to the controls through GetControl method of the current container.
you bound the controls on PreRender using the extension methods exposed for related data. Calling this.DisplayRelatedData() configures the current view and you can retrieve the related items using the GetRelatedItems method.
Code-behind
Widget markup
NOTE: If the widget does not implement ContentView or DynamicContentView, or if it does not have a property ControlDefinition, the widget must be replaced from the widget template inserted on the page.
Register the custom widget via virtual path to the widget If you choose this approach, the custom widget you create must inherit from IRelatedDataView:
Back To Top
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important