I've used something like this for DAMP. There I bind it to a ListView.
Have a look at the source code in DigibizAdvancedMediaPicker.ascx.cs. Look at the set part of the value property on line 236. I have a list and I use ConvertXML to fill that list. You can't use that method exaclty since the xml is a bit different and not recursive (doesn't display the children), but it should get you started :).
Normally I'm just creating a class with properties like src, width, height and such. Something like:
public string Src { get; set; } public string Width { get; set; } public string Height { get; set; }
And then sweep throgh the image collection, create a new object, add it to a list and then bind the repeater to the list with an Image in the itemtemplate.
How do I bind to a Repeater
If I have this -
rptImages.DataSource = umbraco.library.GetMedia(shopImageFolder, true);
rptImages.DataBind();
in code, how do I get a Repeater to display the images found? (There will ONLY be images)
I created a ItemTemplate with an IMG tag, but I can't get the bind bit to work!?
I've used something like this for DAMP. There I bind it to a ListView.
Have a look at the source code in DigibizAdvancedMediaPicker.ascx.cs. Look at the set part of the value property on line 236. I have a list and I use ConvertXML to fill that list. You can't use that method exaclty since the xml is a bit different and not recursive (doesn't display the children), but it should get you started :).
Jeroen
Normally I'm just creating a class with properties like src, width, height and such. Something like:
public string Src { get; set; }
public string Width { get; set; }
public string Height { get; set; }
And then sweep throgh the image collection, create a new object, add it to a list and then bind the repeater to the list with an Image in the itemtemplate.
- Bo
is working on a reply...