Dynamic Module Widget Template: Access data items list from code behind
Hello everyone,
I'm new to Sitefinity and .NET C# development and I think I'm doing some things the wrong way.
I have a custom dynamic module, which has a custom Widget Template for its default Widget. This Widget Template has a codebehind file which looks like this:
namespace
SitefinityWebApp.Custom.WidgetTemplates.ExtranetImages
public
partial
class
ExtranetImagesThumbnails : System.Web.UI.UserControl
I'm filtering items according to some dropdowns by getting a filtered list of items and binding them to the RadListView controller with id "dynamicContentListView". One problem is that this RadListView is already filled in by the default widget controller, so I'm doing it twice.
The second problem is that I would like to keep any filters that might be already setup by the user in the widget parameters, but right now I'm losing them when I get the items based on the dropdowns values.
My question is: Which is the right approach? How can I avoid to load the items twice? How can I get the items before they are binded to the RadListView so I can filter them?
Thanks a lot!
Hello Eduardo,
I suspect you have extended the template by adding the following in your template:
<%@ Control Language="C#" Inherits="SitefinityWebApp.Custom.WidgetTemplates.ExtranetImages.ExtranetImagesThumbnails"%>
It was very helpful indeed, thank you!
I got it working the way I wanted thanks to this post too:
www.sitefinity.com/.../replacing-a-default-view-of-a-sitefintiy-contentview-based-widget