2015-12-14 81 views
0

这是我的代码,当我运行应用程序时,列中的复选框全部变灰,如果有人知道如何避开,以便能够取消选中/检查那太好了。无法取消选中网格视图中的复选框VB.NET

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" DataSourceID="SqlDataSource1" EmptyDataText="There are no data records to display." ForeColor="#333333" Height="310px" Width="946px"> 
     <AlternatingRowStyle BackColor="White" /> 
     <Columns> 
      <asp:BoundField DataField="Id" HeaderText="ID" ReadOnly="True" SortExpression="Id" /> 
      <asp:BoundField DataField="Lender" HeaderText="Lender" ControlStyle-CssClass="lenderimg" SortExpression="Lender" FooterStyle-CssClass="lenderimg"> 
<ControlStyle CssClass="lenderimg"></ControlStyle> 

<FooterStyle CssClass="lenderimg"></FooterStyle> 
      </asp:BoundField> 
      <asp:BoundField DataField="MinLoanAmount" HeaderText="Min Loan Amount" SortExpression="MinLoanAmount" /> 
      <asp:BoundField DataField="MaxLoanAmount" HeaderText="Max Loan Amount" SortExpression="MaxLoanAmount" /> 
      <asp:BoundField DataField="MinTerm" HeaderText="Min Term" SortExpression="MinTerm" /> 
      <asp:BoundField DataField="MaxTerm" HeaderText="Max Term" SortExpression="MaxTerm" /> 
      <asp:BoundField DataField="RepresentativeAPR" HeaderText="Representative APR" SortExpression="RepresentativeAPR" /> 
      <asp:BoundField DataField="SameDayTransfer" HeaderText="Same Day Transfer" SortExpression="SameDayTransfer" /> 
      <asp:BoundField DataField="Active" HeaderText="Active" SortExpression="Active" /> 
      <asp:CheckBoxField DataField="Visible" HeaderText="Visible" SortExpression="Visible" ValidateRequestMode="Inherit" /> 
     </Columns> 
     <EditRowStyle BackColor="#7C6F57" /> 
     <EmptyDataTemplate> 
      <asp:Image ID="Image1" runat="server" ImageUrl="#" /> 
     </EmptyDataTemplate> 
     <FooterStyle BackColor="#1C5E55" ForeColor="White" Font-Bold="True" /> 
     <HeaderStyle BackColor="#353526" Font-Bold="false" ForeColor="White" Height="50" CssClass="header" /> 
     <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" /> 
     <RowStyle BackColor="#E3EAEB" /> 
     <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" /> 
     <SortedAscendingCellStyle BackColor="#353526" /> 
     <SortedAscendingHeaderStyle BackColor="#246B61" /> 
     <SortedDescendingCellStyle BackColor="#D4DFE1" /> 
     <SortedDescendingHeaderStyle BackColor="#15524A" /> 
    </asp:GridView> 
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DataGridConnectionString1 %>" SelectCommand="SELECT * FROM [Table]"></asp:SqlDataSource> 

回答

1

您的数据源是'只读'的。

你需要将它配置有插入,更新和删除语句(单击高级...按钮):

enter image description here

然后你就可以重新连接GridView和其配置为允许编辑。

+0

干杯:)工作:) – YungSam

相关问题