XML Repository

ASP.Net Listview Databinding

by Sir on March 20, 2011

ASP. Net ListView DataBinding

For presenting abstracts like a list, we accept bags of options in Asp.Net like ListView, DataList, Repeater, GridView, DropDownList, etc… Since we accept a arrangement of controls to accept from, the ascendancy can be called based on specific requirements. For e.g. there is a charge of selecting a individual cavalcade again DropDownList is the absolute choice. If paging, sorting, adapt is appropriate again GridView will be the ideal choice. If just charge to echo some html code, again Repeater will plan out to be better. This commodity is mainly focused on VB.Net ListView DataBinding.

DataBinding is quiet agnate to GridView

DataBinding in ListView is about agnate to GridView. There is not abundant apparent difference. There should be atleast one ItemPlaceHolder present in the template. By absence the name of that is itemPlaceholder. Asp.Net allows us to custom name (id) aswell for simple reading.

Flexibility in rendering

This ListView is one of the best controls while adaptability is taken into consideration. With the abstraction of Item Place Holder, we can specify/ configure area the items accept to be placed (rotated). In this example, I accept fabricated a two cavalcade aqueous blueprint . The amount of accumbent beef can be adapted based on the resolution while resizing the browser.

Templates in ListView

There are few templates that will affluence the development accomplishment application ListView. If you accept formed in GridView earlier, again basal templates in ListView are agnate to GridView Templates. There are few appropriate templates. I am highlighting the templates in the afterward list. These templates can be acclimated adapt rendering.

LayoutTemplate

GroupTemplate

ItemTemplate

AlternatingItemTemplate

EditItemTemplate

InsertItemTemplate

ItemSeparatorTemplate

GroupSeparatorTemplate

EmptyItemTemplate

EmptyDataTemplate

SelectedItemTemplate