-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: sans
Message 1 in Discussion
Hi All, I am trying to add radio button to datagrid and assign it values. I am using
the following code there is not error but the radiobutton does not show, can anybody
help me here.. the code which I am using is like this, in the code behind:
private void DataGrid1_ItemDataBound(object sender,
System.Web.UI.WebControls.DataGridCommandEventArgs dg)
{
System.Web.UI.WebControls.Label r;
r = (System.Web.UI.WebControls.Label)dg.Item.FindControl("RadioButton");
r.Text = "<input type='radio' name='myradiogroup' value=" + dg.Item.Cells[2].Text +
">";
}
In the HTML:
<TR>
<TD colspan="4" align="middle">
<asp:DataGrid id="dgProjects" runat="server" BorderColor="White"
BorderStyle="Ridge" BorderWidth="2px" BackColor="White" CellPadding="3"
CellSpacing="1" GridLines="None">
<SelectedItemStyle Font-Bold="True" ForeColor="White"
BackColor="#9471DE"></SelectedItemStyle>
<ItemStyle ForeColor="Black" BackColor="#DEDFDE"></ItemStyle>
<HeaderStyle Font-Bold="True" ForeColor="#E7E7FF"
BackColor="#4A3C8C"></HeaderStyle>
<FooterStyle ForeColor="Black" BackColor="#C6C3C6"></FooterStyle>
<PagerStyle HorizontalAlign="Right" ForeColor="Black"
BackColor="#C6C3C6"></PagerStyle>
<Columns>
<asp:TemplateColumn HeaderText="Mod/Del">
<ItemTemplate>
<asp:Label id="RadioButton" Runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid></TD>
</TR>
Thanks In advance
Santosh
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]