repeater dataBound

S

simon

I have dataRepeater and I use its dataBound event:

Private Sub rprPlists_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.RepeaterItemEventArgs) Handles
rprPlists.ItemDataBound

If (e.Item.ItemType = ListItemType.AlternatingItem Or e.Item.ItemType =
ListItemType.Item) Then

Dim drv As DataRowView
drv = e.Item.DataItem

End If

End Sub

I get an error message:

Specified cast is not valid.

Why, what is wrong here?

Thank you,

Simon
 
J

Joyjit Mukherjee

Hi,

you forget to cast the item from e.item.dataitem to a DataRowView type viz.

drv = (DataRowView) e.Item.DataItem

Thanks
Joyjit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top