- Online Barcode Generator
- How To
- Buy Now
Since most of the time developers need to add list view in their ASP.NET AJAX UI projects for displaying a number of items with predefined layout or customized one, it is quite natural that at times you might need to apply data binding for your listview control.
In this guiding page, we will provide you with a step by step introduction of how you can easily bind your listview control to data source in ASP.NET AJAX application. Currently we support several data binding scenarios for ASP.NET DataSource controls:
Get Started for ListView Data Binding
In order to bind your listview control to one of the data sources introduced in the above list, all you need to do is simply set DataSourceID property and corresponding binding expressions.
DataSourceID is basic property which you should inevitably encounter when setting data binding for your control, like listview in this case. You can just set the DataSourceID of your designing listview to the ID of the Data Source control which you want to bind to. Simple as that.
Once the related DataSourceID is set properly, it is time for you to resort to corresponding ASP.NET binding expressions so that the desired value will display in the concerning listview field.
ListView Data Binding for LinqDataSource
LinqDataSource is one of the ASP.NET 3.5 DataSource supported by Kettic ListView UI control for Asp.NET AJAX. By binding your listview control to LinqDataSource, the Language Integrated Query (LINQ) get exposed to web developers and thus enabling the data quering and updating for your listview.
Below is a complete sample of aspx code snippet for ListView data binding to LinqDataSource. Please feel free to copy to your project or make modification before that.
<kettic:PerListView ID="PerListView1" DataSourceID="LinqDataSource1" runat="server"
ListView Data Binding for EntityDataSource
The second sample we provide for you here is a complete aspx code snippet for Kettic ListView control data binding to EntityDataSource. In the demo, you can see easily that we have set the DataSourceID to EntityDataSource1 first, and after that we proceed with further data binding customization. Please copy to your application for evaluation and make any adjustment as you see fit.
<kettic:PerListView ID="PerListView2" runat="server" DataSourceID="EntityDataSource1"
ASP.NET AJAX UI Controls