CustomDataSource to be introduced in public controls

CustomDataSource to be introduced in public controls

Posted on July 09, 2007 0 Comments

The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.

With the Sitefinity 3.0 Service Pack 2 certain public controls will get a new property: CustomDataSource. The public controls that will get this property are following:

  • Telerik.Blogs.WebControls.PostList;
  • Telerik.News.WebControls.NewsList;
  • Telerik.Lists.WebControls.ListDisplay.

The main advantage of this property is that now you can wrap any of these public controls in a user control (or any other control for that matter), manipulate data the way you see it fit and then set the CustomDataSource property to the IList data source of your choice.

For example, when I was building a Archive control for this blog, I wanted to have a user control and a PostList control inside of it, but I didn't want the PostList control to use it's default data. What I wanted is for PostList control to display only posts published in a particular month. So getting the posts published in specific month is rather easy when you use BlogManager class, but the problem was that I could not influence which posts PostList control will display. And... I'm just too lazy to create a new control from scratch that will display posts, since there is already a control that does that. This led us to introduce the CustomDataSource property.

Though, with PostList and NewsList controls, it may not take too long to recreate the control from scratch, I'm sure you'll appreciate that we have done this for the ListDisplay control, which is moderately complicated control with all the display modes and javascript inside it.

When service pack is out, I'll provide you with sample code for this new feature and illustrate the idea furthermore.
progress-logo

The Progress Team

View all posts from The Progress Team on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.

Comments

Comments are disabled in preview mode.
Topics

Sitefinity Training and Certification Now Available.

Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.

Learn More
Latest Stories
in Your Inbox

Subscribe to get all the news, info and tutorials you need to build better business apps and sites

Loading animation