我正在使用 ASP.NET C# 网格视图,我想在控制中编辑显示在同一页面上的数据。但是当我编写网格视图行编辑事件时,它会在网格视图行中显示文本框,谁能帮助我如何使用 rowediting 事件禁用网格视图中的内联编辑?
<asp:GridView ID="gvItems" runat="server" AutoGenerateColumns="False" AllowPaging="True"
BorderStyle="Solid" BorderWidth="1px" CellPadding="4" ForeColor="#333333" GridLines="None"
OnPageIndexChanging="gvItems_PageIndexChanging" Width="901px"
OnRowCommand="gvItems_RowCommand" OnSelectedIndexChanged="gvItems_SelectedIndexChanged" OnRowDataBound="gvItems_RowDataBound" OnRowEditing="gvItems_RowEditing">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:ButtonField Text="Edit" CommandName="Change" />
<asp:ButtonField Text="Addend" CommandName="Addend" />
<asp:BoundField DataField="ItemID" HeaderText="ID" />
<asp:BoundField DataField="Project" HeaderText="Project" SortExpression="Project" />
<asp:BoundField DataField="Type" HeaderText="Type" />
<asp:BoundField DataField="Release" HeaderText="Release" />
<asp:BoundField DataField="Priority" HeaderText="Priority" />
<asp:BoundField DataField="Severity" HeaderText="Severity" />
<asp:BoundField DataField="Client" HeaderText="Client" />
<asp:BoundField DataField="Status" HeaderText="Status" />
<asp:BoundField DataField="Subject" HeaderText="Subject" />
<asp:BoundField DataField="CreatedDate" DataFormatString="{0:d}" HeaderText="Created Date" />
<asp:TemplateField>
<ItemTemplate>
<!--To fire the OnRowEditing event.-->
<asp:LinkButton ID="lbView" runat="server" CommandName="View"
Text="View" CommandArgument="<%# Container.DataItemIndex %>">
</asp:LinkButton>
<asp:HiddenField runat="server" ID="hdnItemID" Value='<%#Eval("ItemID") %>'>
</asp:HiddenField>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" />
<PagerSettings Mode="NumericFirstLast" />
<PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
<RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
<SortedAscendingCellStyle BackColor="#FDF5AC" />
<SortedAscendingHeaderStyle BackColor="#4D0000" />
<SortedDescendingCellStyle BackColor="#FCF6C0" />
<SortedDescendingHeaderStyle BackColor="#820000" />
</asp:GridView>