2015-12-14 76 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

相關問題