View Single Post
  #22 (permalink)  
Old April 7th, 2010, 12:10 PM
martinspalding martinspalding is offline
Registered User
 
Join Date: Mar 2010
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm trying to build my listview's ItemDataBound event from the same event from your repeater example but I get the below error...?

protected void lvTrustAccounts_ItemDataBound(object sender, ListViewItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) (ERROR: operator '||' and '==' cannot be applied to operands of type 'System.Web.UI.WebControls.ListViewItemType' and ''System.Web.UI.WebControls.ListItemType')
{
ContentRating myRating = e.Item.FindControl("Rating1") as ContentRating;
if (myRating != null)
{
Book myBook = e.Item.DataItem as Book;
if (myBook != null)
{
myRating.ItemId = myBook.Id;
myRating.DataSource = myBook.Rating;
}
}
}
}