View Single Post
  #3 (permalink)  
Old June 13th, 2009, 04:57 PM
Lee Dumond's Avatar
Lee Dumond Lee Dumond is offline
Wrox Author
Points: 4,942, Level: 29
Points: 4,942, Level: 29 Points: 4,942, Level: 29 Points: 4,942, Level: 29
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2008
Location: Decatur, IL, USA.
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

Sorry Phillip, there is a slight error in your code.

Code:
protected void listProducts_ItemDataBound(object sender, ListViewItemEventArgs e)
{
   if (e.Item.ItemType == ListViewItemType.DataItem)
   {
      ListViewDataItem dataItem = (ListViewDataItem) e.Item;
      string prodtype = (string) DataBinder.Eval(dataItem.DataItem, "ProductType");
      if (prodtype == "Sample")
      {
         // do your thing here
      }
   }
}
You got the right idea though.
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}
The Following 2 Users Say Thank You to Lee Dumond For This Useful Post:
philip_cole (June 14th, 2009)