Dynamic Module Widget Template: Access data items list from

Posted by Community Admin on 04-Aug-2018 09:30

Dynamic Module Widget Template: Access data items list from code behind

All Replies

Posted by Community Admin on 25-Jul-2014 00:00

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!

 

 

1.namespace SitefinityWebApp.Custom.WidgetTemplates.ExtranetImages
2.
3.  public partial class ExtranetImagesThumbnails : System.Web.UI.UserControl
4.  
5.  
6.

Posted by Community Admin on 30-Jul-2014 00:00

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"%>

Actually by doing the above you are extending the build-in functionality, but you rather need to override it, so the above approach will not help.

I could suggest you to read Boyan Barnev`s blogpost, where is explained how to filter items in a custom template and bind them to a RadComboBox: Filtering Sitefinity ContentView-based Controls on the Frontend

Hope this helps.

Regards,
Vassil Vassilev
Telerik
 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 30-Jul-2014 00:00

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

This thread is closed