RadioButtonList control bounded in a datagrid ?

Discussion in 'ASP.NET / ASP.NET Core' started by ashrafcsnet, Jun 30, 2005.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. how do I add a radiobuttonlist into a datagrid with their selected values from the database ?
    <asp:TemplateColumn><asp:TemplateColumn></headERTEMPLATE><ITEMTEMPLATE><asp:RadioButtonList id=rbl1 SelectedValue='<%# DataBinder.Eval(Container.DataItem,"DEFAULTYN") %>' DataValueField="DEFAULTYN" DataTextField="DEFAULTYN" Runat="server" RepeatDirection="Horizontal" DataSource="<%# ds %>"></asp:RadioButtonList></ITEMTEMPLATE></asp:TemplateColumn></headERTEMPLATE><ITEMTEMPLATE><asp:RadioButtonList id=rbl1 SelectedValue='<%# DataBinder.Eval(Container.DataItem,"DEFAULTYN") %>' DataValueField="DEFAULTYN" DataTextField="DEFAULTYN" Runat="server" RepeatDirection="Horizontal" DataSource="<%# ds %>"></headERTEMPLATE><ITEMTEMPLATE><asp:RadioButtonList id=rbl1 SelectedValue='<%# DataBinder.Eval(Container.DataItem,"DEFAULTYN") %>' DataValueField="DEFAULTYN" DataTextField="DEFAULTYN" Runat="server" RepeatDirection="Horizontal" DataSource="<%# ds %>"></asp:RadioButtonList></asp:RadioButtonList></asp:TemplateColumn>
    <asp:TemplateColumn><asp:RadioButtonList SelectedValue='<%# DataBinder.Eval(Container.DataItem,"DEFAULTYN") %>' DataValueField="DEFAULTYN" DataTextField="DEFAULTYN" Runat="server" RepeatDirection="Horizontal" DataSource="<%# ds %>"><asp:RadioButtonList SelectedValue='<%# DataBinder.Eval(Container.DataItem,"DEFAULTYN") %>' DataValueField="DEFAULTYN" DataTextField="DEFAULTYN" Runat="server" RepeatDirection="Horizontal" DataSource="<%# ds %>"><asp:TemplateColumn>
    <HeaderTemplate>
    Defualt
    </HeaderTemplate>
    <ItemTemplate>
    <asp:RadioButtonList ID="rbl1" DataSource="<%# ds %>" RepeatDirection="Horizontal" Runat="server" DataTextField="DEFAULTYN" DataValueField="DEFAULTYN" SelectedValue='<%# DataBinder.Eval(Container.DataItem,"DEFAULTYN") %>' />
    </ItemTemplate>
    </asp:TemplateColumn></asp:RadioButtonList></asp:RadioButtonList></asp:TemplateColumn>
    <asp:TemplateColumn><asp:RadioButtonList SelectedValue='<%# DataBinder.Eval(Container.DataItem,"DEFAULTYN") %>' DataValueField="DEFAULTYN" DataTextField="DEFAULTYN" Runat="server" RepeatDirection="Horizontal" DataSource="<%# ds %>"><asp:RadioButtonList SelectedValue='<%# DataBinder.Eval(Container.DataItem,"DEFAULTYN") %>' DataValueField="DEFAULTYN" DataTextField="DEFAULTYN" Runat="server" RepeatDirection="Horizontal" DataSource="<%# ds %>"></asp:RadioButtonList></asp:RadioButtonList></asp:TemplateColumn>
    <asp:TemplateColumn><asp:RadioButtonList SelectedValue='<%# DataBinder.Eval(Container.DataItem,"DEFAULTYN") %>' DataValueField="DEFAULTYN" DataTextField="DEFAULTYN" Runat="server" RepeatDirection="Horizontal" DataSource="<%# ds %>"><asp:RadioButtonList SelectedValue='<%# DataBinder.Eval(Container.DataItem,"DEFAULTYN") %>' DataValueField="DEFAULTYN" DataTextField="DEFAULTYN" Runat="server" RepeatDirection="Horizontal" DataSource="<%# ds %>">DEFAULTYN is the column name in the table....</asp:RadioButtonList></asp:RadioButtonList></asp:TemplateColumn>
    <asp:TemplateColumn><asp:RadioButtonList SelectedValue='<%# DataBinder.Eval(Container.DataItem,"DEFAULTYN") %>' DataValueField="DEFAULTYN" DataTextField="DEFAULTYN" Runat="server" RepeatDirection="Horizontal" DataSource="<%# ds %>"><asp:RadioButtonList SelectedValue='<%# DataBinder.Eval(Container.DataItem,"DEFAULTYN") %>' DataValueField="DEFAULTYN" DataTextField="DEFAULTYN" Runat="server" RepeatDirection="Horizontal" DataSource="<%# ds %>"></asp:RadioButtonList></asp:RadioButtonList></asp:TemplateColumn>
    <asp:TemplateColumn><asp:RadioButtonList SelectedValue='<%# DataBinder.Eval(Container.DataItem,"DEFAULTYN") %>' DataValueField="DEFAULTYN" DataTextField="DEFAULTYN" Runat="server" RepeatDirection="Horizontal" DataSource="<%# ds %>"><asp:RadioButtonList SelectedValue='<%# DataBinder.Eval(Container.DataItem,"DEFAULTYN") %>' DataValueField="DEFAULTYN" DataTextField="DEFAULTYN" Runat="server" RepeatDirection="Horizontal" DataSource="<%# ds %>">the radiobuttonlist in the datagrid is not genarated correct whyyy ? Can you please just acopy for me a correct one ?</asp:RadioButtonList></asp:RadioButtonList></asp:TemplateColumn>
    <asp:TemplateColumn><asp:RadioButtonList SelectedValue='<%# DataBinder.Eval(Container.DataItem,"DEFAULTYN") %>' DataValueField="DEFAULTYN" DataTextField="DEFAULTYN" Runat="server" RepeatDirection="Horizontal" DataSource="<%# ds %>"><asp:RadioButtonList SelectedValue='<%# DataBinder.Eval(Container.DataItem,"DEFAULTYN") %>' DataValueField="DEFAULTYN" DataTextField="DEFAULTYN" Runat="server" RepeatDirection="Horizontal" DataSource="<%# ds %>"></asp:RadioButtonList></asp:RadioButtonList></asp:TemplateColumn>
    <asp:TemplateColumn><asp:RadioButtonList SelectedValue='<%# DataBinder.Eval(Container.DataItem,"DEFAULTYN") %>' DataValueField="DEFAULTYN" DataTextField="DEFAULTYN" Runat="server" RepeatDirection="Horizontal" DataSource="<%# ds %>"><asp:RadioButtonList SelectedValue='<%# DataBinder.Eval(Container.DataItem,"DEFAULTYN") %>' DataValueField="DEFAULTYN" DataTextField="DEFAULTYN" Runat="server" RepeatDirection="Horizontal" DataSource="<%# ds %>">Thanx alot</asp:RadioButtonList></ITEMTEMPLATE></asp:RadioButtonList></ITEMTEMPLATE></asp:TemplateColumn><headERTEMPLATE></headERTEMPLATE><ITEMTEMPLATE></ITEMTEMPLATE>
     
  2. Thanx all I solved the problem hehehe...



    <asp:TemplateColumn>
    <HeaderTemplate>
    Defualt
    </HeaderTemplate>
    <ItemTemplate>
    <asp:RadioButtonList ID="RadioButtonList1" SelectedValue='<% # DataBinder.Eval(Container.DataItem,"DEFAULTYN") %>' RepeatDirection="Horizontal" Runat="server">
    <asp:ListItem Value="Y">Yes</asp:ListItem>
    <asp:ListItem Value="N">No</asp:ListItem>
    </asp:RadioButtonList>
    </ItemTemplate>
    </asp:TemplateColumn><headERTEMPLATE></headERTEMPLATE><ITEMTEMPLATE></ITEMTEMPLATE>
    May it would help :)))))
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page