如何设置单选的属性。

解决方案 »

  1.   

    哪果只是真假两个选项是不是应该用 checkbox 
    再都. radiobutton 选中的值是指定的.在设计期指定///*************************///
    这两年来慢慢习惯了光说不练
    ///*************************///
      

  2.   

    <asp:TemplateColumn>
    <HeaderTemplate>
    </FONT>
    </HeaderTemplate>
    <ItemTemplate>
    <FONT face="宋体">
    <asp:RadioButtonList id=RadioButtonList1 runat="server" Width="174px" SelectedValue='<%# DataBinder.Eval(Container.DataItem, "审核标志") %>' RepeatColumns="3" >
    <asp:ListItem Value="0">未审</asp:ListItem>
    <asp:ListItem Value="1">审核</asp:ListItem>
    <asp:ListItem Value="2">冻结</asp:ListItem>
    </asp:RadioButtonList></FONT>
    </ItemTemplate>
    <EditItemTemplate>
    <FONT face="宋体"></FONT>
    </EditItemTemplate>
    这段代码才你有没有帮助.///*************************///
    这两年来慢慢习惯了光说不练
    ///*************************///
      

  3.   

    <asp:TemplateColumn HeaderText="选项">
    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="30px"></HeaderStyle>
    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="30px"></ItemStyle>
    <ItemTemplate>
    <asp:RadioButton GroupName="ss" Runat=server Checked=False />
    </ItemTemplate>
    </asp:TemplateColumn>
      

  4.   

    上面是我的代码。如果改成RadioButtonList控件。我的页面上有多少条数据,就要多次<asp:ListItem Value="0">未审</asp:ListItem>这样吗?这样好象不可取吧!
    还有更好的,办法吗?
      

  5.   

    .Net创建控件默认是按照控件树的次序命名,解决的办法:
    1、使用html标签(radio),然后用脚本实现保存选择内容;
    2、自己写一个用户控件或去找各用户控件(CodeProject上面有)