我有一个可以通过编辑按钮编辑的gridview:
按编辑后:
当用户按下“编辑”时,我不希望第一列“活动日期”是可编辑的。
如何防止此控件更改为文本框?
编辑这里是gridview代码:
<asp:GridView ID="viewHoursGridView" runat="server" AllowPaging="True" AutoGenerateColumns="False"
DataSourceID="SqlDataSource6" DataKeyNames="PK_DailyTaskHours"
BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px"
CellPadding="3" CellSpacing="2" Width="94%" OnRowDeleting="viewHoursGridView_OnRowDeleting" OnRowEditing="viewHoursGridView_RowEditing" OnRowUpdating="viewHoursGridView_RowUpdating"
OnRowDataBound="viewHoursGridView_OnRowDataBound" CssClass="centerGridView">
<Columns>
<asp:BoundField DataField="ActivityDate" HeaderText="Activity Date" SortExpression="ActivityDate" DataFormatString="{0:MM/dd/yyyy}" />
<asp:BoundField DataField="Hours" HeaderText="Hours" SortExpression="Hours" />
<asp:BoundField DataField="Notes" HeaderText="Notes" SortExpression="Notes" />
<asp:BoundField DataField="CreateDate" HeaderText="Created Date" SortExpression="CreateDate" Visible="false" />
<asp:CommandField ShowDeleteButton="True" />
<asp:CommandField ShowEditButton="True" />
</Columns>
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#7fc041" Font-Bold="True" ForeColor="White" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SortedAscendingCellStyle BackColor="#FFF1D4" />
<SortedAscendingHeaderStyle BackColor="#B95C30" />
<SortedDescendingCellStyle BackColor="#F1E5CE" />
<SortedDescendingHeaderStyle BackColor="#93451F" />
</asp:GridView>