View Single Post
  #1 (permalink)  
Old June 13th, 2009, 02:48 PM
westannex westannex is offline
Authorized User
Join Date: Mar 2009
Posts: 14
Thanks: 1
Thanked 0 Times in 0 Posts
Default ItemDataBound on ListView


I'm trying to convert an example of a RowDataBound event for a GridView, to an ItemDataBound event for a ListView.

This is what I'm starting with:

protected void gridProducts_RowDataBound(object sender, GridViewRowEventArgs e)
if (e.Row.RowType == DataControlRowType.DataRow)
string prodtype = (string)DataBinder.Eval(e.Row.DataItem, "ProductType");
if (prodtype == "Sample" )

This is as far as I get on the conversion:

protected void listProducts_ItemDataBound(object sender, ListViewItemEventArgs e)
if (e.Item.ItemType == ListViewItemType.DataItem)
string prodtype = (string).....

Where do I go next?