我正在使用gridview,我的问题是如果用户选择第二个复选框,则用户只能在网格中选择一个复选框,我们将取消选中。我尝试使用 javascript,但这对我不起作用,请您帮帮我,我该怎么做。下面是我的网格视图
<data:EntityGridView ID="gvService" Width="100%" DataKeyNames="PriceSystemID" runat="server"
OnRowEditing="GridView1_RowEditing" OnRowCommand="gvServices_ItemCommand" AutoGenerateColumns="False"
OnRowDeleting="gvService_RowDeleting" ShowFooter="true" OnRowCancelingEdit="gvService_RowCancelingEdit"
>
<Columns>
<asp:TemplateField HeaderText="Service">
<ItemTemplate>
<data:EntityDropDownList runat="server" ID="dataServiceTypeId1" DataSourceID="ServiceTypeIdServiceTypesDataSource"
DataTextField="Description" DataValueField="ServiceTypeId" SelectedValue='<%# Bind("ServiceTypeID") %>' Width="200px"
AppendNullItem="true" Required="true" NullItemText="< Please Choose ...>" ErrorText="Required" />
<data:ServiceTypesDataSource ID="ServiceTypeIdServiceTypesDataSource" runat="server"
SelectMethod="GetAll" />
</ItemTemplate>
<EditItemTemplate>
<data:EntityDropDownList runat="server" ID="dataServiceTypeId2" DataSourceID="ServiceTypeIdServiceTypesDataSource"
DataTextField="Description" DataValueField="ServiceTypeId" Width="200px" AutoPostBack="true"
SelectedValue='<%# Bind("ServiceTypeID") %>' AppendNullItem="true" Required="true"
NullItemText="< Please Choose ...>" ErrorText="Required" />
<data:ServiceTypesDataSource ID="ServiceTypeIdServiceTypesDataSource" runat="server"
SelectMethod="GetAll" />
</EditItemTemplate>
<FooterTemplate>
<data:EntityDropDownList runat="server" ID="dataServiceTypeId3" DataSourceID="ServiceTypeIdServiceTypesDataSource"
AutoPostBack="true" DataTextField="Description" DataValueField="ServiceTypeId" Width="200px"
SelectedValue='<%# Bind("ServiceTypeID") %>' AppendNullItem="true" Required="true"
NullItemText="< Please Choose ...>" ErrorText="Required" />
<data:ServiceTypesDataSource ID="ServiceTypeIdServiceTypesDataSource" runat="server"
SelectMethod="GetAll" />
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Default">
<ItemTemplate>
<asp:CheckBox ID="chkDefault" Checked='<%# Bind("IsDefault") %>'
runat="server" />
</ItemTemplate>
<EditItemTemplate>
<asp:CheckBox ID="chkDefault" Checked='<%# Bind("IsDefault") %>' runat="server" />
</EditItemTemplate>
<FooterTemplate>
<asp:CheckBox ID="chkDefault" Checked='<%# Bind("IsDefault") %>' runat="server" />
</FooterTemplate>
</asp:TemplateField>
' CausesValidation="false">
<EmptyDataTemplate>
</EmptyDataTemplate>
</data:EntityGridView>