Listview vs GridView (compare)























COMPARE LISTVIEW AND GRIDVIEW


In a ListView, We are able to introduce Insert, Edit and Delete. But
GridView has only Edit and Delete and NOT Insert.Why?

Just use ListView() whereever possible.. It can do the job of GridView,Repeater
and DataList.


ListView does not have the paging facility. But you can implement it
as a separate external control(called as DataPager).


DataPager will work only with ListView NOT with GridView or Repeater.

So Let us forget GridView and Repeater and concentrate on ListView only.

DataPager:He is a Servant Control. That means you should tell him who
his master is.


<asp:DataPager.......PagedControlID="ListView1"........>.........</asp:DataPager>


 

Disadvantage of ListView : Sorting is not possible. You have arrange separately.

Class ASP Textbox:


<input type="text" name="EmpName" size="35"
maxlength="100" value="<%=EmpName%>" />

Working with the ASP.NET TextBox Control


<asp:TextBox runat="server" id="EmpName" Columns="35"
MaxLength="100" Text='<%# Bind("EmpName")%>'
></asp:TextBox>


Remember the apostrophe.


Other important textbox properties :


TextMode="SingleLine |MultiLine |Password"


AutoPostBack="True | False"