Edit template grid

A

anonymous22

I have the following code for grid, however I can bind the
data in itemtemplate when it comes to bind the data in
edittemplate I have some problem: I would like to have a
redio box selected based on value.How do I do this?
<ItemTemplate>
<asp:Label width=100 id="llbGender" Runat=server text='<%#
DataBinder.Eval(Container.DataItem,"Sex") %>' />
</ItemTemplate>
<EditItemTemplate>
<asp:RadioButtonList id="rbGender" width="100"
runat="server">
<asp:listitem id="genderMale" runat="server"
value="M">Male</asp:listitem>
<asp:listitem id="genderFemal" runat="server"
value="F">Female</asp:listitem>
</asp:RadioButtonList>
<asp:RequiredFieldValidator ControlToValidate="rbGender"
id="Requiredfieldvalidator4" runat="server"
ErrorMessage="Please select
gender"></asp:RequiredFieldValidator>
</EditItemTemplate>
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,067
Latest member
HunterTere

Latest Threads

Top