我有一个绑定到数据源的gridview。
<asp:GridView ID="DocumentReviewGrid" runat="server" AllowPaging="True" AllowSorting="True"
EnableModelValidation="True" Width="100%" BorderStyle="None"
CssClass="docnav_data" BorderWidth="1px" GridLines="None" DataSourceID="DocumentReviewDataSource"
HorizontalAlign="Left" OnRowDataBound="DocumentReviewGrid_RowDataBound"
OnRowCreated="DocumentReviewGrid_RowCreated" CellSpacing="5"
PageSize="20" OnPageIndexChanged="DocumentReviewGrid_PageIndexChanged">
<AlternatingRowStyle BackColor="#EBF2F9" BorderStyle="None" />
<FooterStyle HorizontalAlign="Left" />
<HeaderStyle BackColor="#E7E7E7" HorizontalAlign="Left" />
<PagerSettings Mode="NumericFirstLast" Position="Top" PageButtonCount="4" />
<PagerStyle HorizontalAlign="Center" />
</asp:GridView>
如您所见,自动生成的列设置为 true,并且必须保持这种状态。其中一列是 SQL 位值,因此它表示为复选框。我希望能够只编辑复选框列,而不使用“AutoGenerateEditButton”属性。我只想:
- 能够选中/取消选中复选框(我被困在这里)
- 使用外部按钮执行单个更新
- 其他列必须是只读的