all groups > asp.net building controls > november 2005 >
You're in the

asp.net building controls

group:

Custom Templated Databound Control or derived control?


Custom Templated Databound Control or derived control? MattC
11/23/2005 12:00:00 AM
asp.net building controls:
Hi,

I want to create a control that performs much like a datalist but I want
more control over how the <ItemTemplate> contents is set out on the page.
For example I have a 4 by N grid of images to set out on the page, how the
first row is slightly different in taht the first image is twice the size of
the rest, so the first row only have 3 images the remaining rows have 4
images. Would I be best to derive my own control from Repeater? What
methods will I need to override to alter the layout to design required.

The information about the images is stored in a collection of classes so I
will need to use the DataBinder.Eval(...) method.

TIA


MattC

Re: Custom Templated Databound Control or derived control? S.M. Altaf [MVP]
11/25/2005 12:00:00 AM
Matt,

I think you can still use the DataRepeater control for this, by handling the
ItemDataBound event and 'merging' the first two cells of the first row in
there.

HTH
Altaf
--------------------------------------------------------------------------------
All that glitters has a high refractive index.
www.mendhak.com

[quoted text, click to view]

AddThis Social Bookmark Button