ASPX templates
Version 4.x > ASPX templates > Can I use the ASP.NET ListView control? View modes: 
User avatar
Member
Member
random0xff - 5/23/2009 2:45:19 PM
   
Can I use the ASP.NET ListView control?
I wish to use the asp:ListView control, it's a new control in ASP.NET 3.5 and very flexible. With this control I can do things that would be much more complicated with for instance the QueryRepeater in Kentico.

But I need a DataSource for the ListView. I tried to use QueryDataSource, but it doesn't implement IDataSource, so it's not usable as a data source for the ListView.

1. Why is this control called QueryDataSource when it doesn't implement from IDataSource? That is confusing for ASP.NET developers, please check out the naming guidelines from Microsoft before you develop new controls to give them appropriate names.
2. What is a good way to pass data to from the CMS to a ListView? Either through controls of from the code-behind.

Thank you!

User avatar
Kentico Developer
Kentico Developer
kentico_zbysekn - 5/25/2009 8:57:46 AM
   
RE:Can I use the ASP.NET ListView control?
Hello,
1. All controls marked with preposition CMS are our Controls which use our naming convention, our users are common with it so it can be really confusing to change it.

2. As far as I know you don't need to have Class implementing IDataSource to bind data to ListView control. ListView control should be bindable to any DataSet and our DataSources contain these DataSets.
In case you want to use DataSource you can use for example Object datasource and implement it's methods so it work with data from CMS. In this case these examples from our Dev-Guide will help you to implement these methods (Select,Insert,Update,Delete).

Best Regards,
Zbysek Nemec.

User avatar
Member
Member
random0xff - 5/28/2009 3:11:40 PM
   
RE:Can I use the ASP.NET ListView control?
Ok, thanks. I will try the object data source coupled with the TreeProvider or TreeHelper object.

User avatar
Member
Member
rwinningham - 6/3/2009 3:31:52 PM
   
RE:Can I use the ASP.NET ListView control?
You mentioned that your DataSources contain a DataSet. Which property or method provides the DataSet for CMSDocumentsDataSource?

Thanks

User avatar
Member
Member
rwinningham - 6/3/2009 3:42:03 PM
   
RE:Can I use the ASP.NET ListView control?
Ok, I feel dumb. It's the DataSource property. Like the person who posted this, I was expecting the CMSDocumentsDataSource object to be of type IDataSource.