By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,058 Members | 1,213 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,058 IT Pros & Developers. It's quick & easy.

Data Repeater - Dynamic template depending on data

P: n/a
I have a repeater that I need to display one of three different templates,
depending on a status bit in the data (e.g. if status = 0, display a basic
template, 1 = with picture, 2 = with picture + extra text)

Is this possible? If so, does anyone have a link to a good tutorial or
example?

Thanks in advance,

Duncan
Nov 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi,

Well you have two choises:
1- Create 3 Repeaters and bind/show the needed one. This is the easiest
solution just that you create two controls that you know for sure you will
not use. Even so I believe this is the way to go.
2- Create the ItemTemplate collection to build the control as needed, this
is more error prone and you will need more code for it.
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Dunc" <du**@ntpcl.f9.co.uk> wrote in message
news:uC**************@TK2MSFTNGP09.phx.gbl...
I have a repeater that I need to display one of three different templates,
depending on a status bit in the data (e.g. if status = 0, display a basic
template, 1 = with picture, 2 = with picture + extra text)

Is this possible? If so, does anyone have a link to a good tutorial or
example?

Thanks in advance,

Duncan

Nov 17 '05 #2

P: n/a
Sorry - think I phrased that badly. One list could potentially contain all
three different layouts, at any given location.

Any other thoughts?

Duncan
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:ud*************@tk2msftngp13.phx.gbl...
Hi,

Well you have two choises:
1- Create 3 Repeaters and bind/show the needed one. This is the easiest
solution just that you create two controls that you know for sure you will
not use. Even so I believe this is the way to go.
2- Create the ItemTemplate collection to build the control as needed, this
is more error prone and you will need more code for it.
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Dunc" <du**@ntpcl.f9.co.uk> wrote in message
news:uC**************@TK2MSFTNGP09.phx.gbl...
I have a repeater that I need to display one of three different templates,
depending on a status bit in the data (e.g. if status = 0, display a basic
template, 1 = with picture, 2 = with picture + extra text)

Is this possible? If so, does anyone have a link to a good tutorial or
example?

Thanks in advance,

Duncan


Nov 17 '05 #3

P: n/a
Hi,

It does not matter, the list is the datasource, the repeaters are just the
way you will show it, are the repeaters the one that show it differently.

I still think the idea of having 3 repeaters and showing only the one you
want is the best option

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Dunc" <du**@ntpcl.f9.co.uk> wrote in message
news:eu**************@TK2MSFTNGP09.phx.gbl...
Sorry - think I phrased that badly. One list could potentially contain
all three different layouts, at any given location.

Any other thoughts?

Duncan
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us>
wrote in message news:ud*************@tk2msftngp13.phx.gbl...
Hi,

Well you have two choises:
1- Create 3 Repeaters and bind/show the needed one. This is the easiest
solution just that you create two controls that you know for sure you
will not use. Even so I believe this is the way to go.
2- Create the ItemTemplate collection to build the control as needed,
this is more error prone and you will need more code for it.
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Dunc" <du**@ntpcl.f9.co.uk> wrote in message
news:uC**************@TK2MSFTNGP09.phx.gbl...
I have a repeater that I need to display one of three different
templates, depending on a status bit in the data (e.g. if status = 0,
display a basic template, 1 = with picture, 2 = with picture + extra
text)

Is this possible? If so, does anyone have a link to a good tutorial or
example?

Thanks in advance,

Duncan



Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.