【发布时间】:2026-02-16 22:50:02
【问题描述】:
使用GridView1.Columns(0).Visible = False 隐藏fld1(第一列),但我想隐藏每一行旁边的编辑选项。你是怎么做到的?
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:AttendanceDBConnectionString %>"
SelectCommand="SELECT [fld1], [fld2], [fld3], [fld4], [fld5] FROM [fld6] ORDER BY [fld1], [fld2], [fld3]">
</asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
AutoGenerateEditButton="True" DataSourceID="SqlDataSource1" PageSize="100">
</asp:GridView>
Protected Sub GridView1_DataBound(sender As Object, e As EventArgs) Handles GridView1.DataBound
GridView1.Columns(0).Visible = False
End Sub
【问题讨论】: