DataRepeater NewItem & DrawItem Advice

curlydog

Well-known member
Joined
Jul 5, 2010
Messages
50
Programming Experience
Beginner
Hi,
I have a dataRepeater which is populated by an dataList of objects and using .AddNew to add them to the datarepeater. The objects can on one of two types (A or B). I'm trying to display a picture in the repeater depending on the type of object.

I'm finding that at NewItem, I can determine the object type, but I can't access the picturebox in the repeater. As part of my debuggin I've iterated through the controls on the datarepeater and can see the picturebox name, but If I try and set the image in it I get an error.

At DrawItem I can access the picturebox, but I can't determine the object type. I've set up the same if statement that I used in the NewItem routine, using
VB.NET:
If TypeOf (currentItem) Is A Then
....
Else If TypeOf (currentItem) Is B Then
....
End If
but the statement is ignored

I've used addNew to populate the datarepeater as it appears to be the only way I can use objects of two different types. I can't use an array, as I have done in the past, as I need to specify a single object type for the array.

I'd appreciate any advice
Jason
 
Back
Top