Tips and tricks for .NET using ASP and VB code.

Make a bound checkbox field into a radiobutton field.

Convert the bound field to a TemplateField.

Replace:
<ItemTemplate>
    <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("FieldName") %>' Enabled="false" />
</ItemTemplate>

With:
<ItemTemplate>
    <b>
        <asp:RadioButton ID="RadioButton1" GroupName="RadioButtons" runat="server" Text="True" Checked='True' Enabled="false" />
        <asp:RadioButton ID="RadioButton2" GroupName="RadioButtons" runat="server" Text="False" Checked='<%# Bind("FieldName") %>' Enabled="false" />
    </b>
</ItemTemplate>

No comments:

Post a Comment

Search This Blog