setting selecteditem item on databound radiobuttonlist in a repeater

  • Thread starter Thread starter Rod Snyder
  • Start date Start date
R

Rod Snyder

I'm trying to figure out how to set the selected item of databound
radiolistbutton once they are in a repeater (i.e. I want one item
pre-selected instead of nothing selected). In the html there is a property
for selecteditem but it generates an error saying it can only be set at
runtime. Haven't been able to figure out or find how to do that.

Any help or direction would be appreciated.
Rod
 
radiobuttonlist.selecteditem is a "read only" property--you can't set it. Set
either selectedvalue or selectedindex, which you can do either by databinding
in the html or at ItemDataBound in the code-behind.

Bill
 
Back
Top