Customised web controls in a data list/repeator

  • Thread starter Thread starter Steve Lloyd
  • Start date Start date
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
 
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
 
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
 
Back
Top