Customised web controls in a data list/repeator

S

Steve Lloyd

Hi there,

I have a set of products each of which has attributes (color size etc), is
it possible to use a data list or repeator to display all the items and
provide combo box with a unique set of attributes in each list/repeator item
as a sort of sub query.

Thanks for any help,

Steve
 
R

Raterus

Sure, do it in the itemdatabound event. First place an empty radiobutton list where you want it to appear.

then in ItemDataBound, you'll need to do something like this (This example is for a datagrid, but a datalist/repeater shouldn't be much different)

If e.Item.ItemType <> ListItemType.Header AND _
e.Item.ItemType <> ListItemType.Footer then
Dim rbl as RadioButtonList = e.Item.Cells(0).Controls(0) 'the hard part is figuring out exactly where the radiobuttonlist is in the mess

rbl.datasource = "whatever"
...
rbl.databind
End If
 
S

Steve Lloyd

Shall give that a go, thanks


Sure, do it in the itemdatabound event. First place an empty radiobutton
list where you want it to appear.

then in ItemDataBound, you'll need to do something like this (This example
is for a datagrid, but a datalist/repeater shouldn't be much different)

If e.Item.ItemType <> ListItemType.Header AND _
e.Item.ItemType <> ListItemType.Footer then
Dim rbl as RadioButtonList = e.Item.Cells(0).Controls(0) 'the hard
part is figuring out exactly where the radiobuttonlist is in the mess

rbl.datasource = "whatever"
...
rbl.databind
End If
 

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,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top