I have a DataList with an Item Template that contains an image and
three radio buttons, which are used to indicate the image's status. How
can I set the appropriate radio button to checked, when I load the
DataList from the database?
Thanks in advance.
PierreHi pierre
How u know the image status
better use RadioButtonList rather than tree RadioButton
"pierre.basson@.psitek.com" wrote:
> Hi,
> I have a DataList with an Item Template that contains an image and
> three radio buttons, which are used to indicate the image's status. How
> can I set the appropriate radio button to checked, when I load the
> DataList from the database?
> Thanks in advance.
> Pierre
>
Pierre,
You need to make a databind expression for button's Checked property. Read
about databinding in MSDN Library.
Eliyahu
<pierre.basson@.psitek.com> wrote in message
news:1107355773.020943.104090@.g14g2000cwa.googlegr oups.com...
> Hi,
> I have a DataList with an Item Template that contains an image and
> three radio buttons, which are used to indicate the image's status. How
> can I set the appropriate radio button to checked, when I load the
> DataList from the database?
> Thanks in advance.
> Pierre
Handle the ItemDataBound event in your code. Then get the RadioButtonList
using:
RadioButtonList rbl = (RadioButtonList) e.Item.FindControl("myRBL");
This gets the RadioButtonList for the current item in the DataList. Then set
as selected the RadioButton you like.
Hope this helps!
Regards,
Kostadin Kostov
"pierre.basson@.psitek.com" wrote:
> Hi,
> I have a DataList with an Item Template that contains an image and
> three radio buttons, which are used to indicate the image's status. How
> can I set the appropriate radio button to checked, when I load the
> DataList from the database?
> Thanks in advance.
> Pierre
>
0 comments:
Post a Comment