gridView编辑列
我在gridView中添加了编辑列的触发事件,但是我要点击两遍“编辑”,单元格才处于可编辑状态。求教:如何点击一次“编辑”,就可以呈现编辑状态。前台页面:<sinopec...
我在gridView中添加了编辑列的触发事件,但是我要点击两遍“编辑”,单元格才处于可编辑状态。求教:如何点击一次“编辑”,就可以呈现编辑状态。
前台页面:
<sinopec:SmartGridView ID="gvList" runat="server" AllowSorting="True"
AutoGenerateColumns="False" CurrentSortDirection="Descending"
DataBindHandler="bindgvList" EmptyDataText="没有符合条件的数据" PagerBinding="pagerList"
SortButtonImageFold="~/Images/" Width="100%" CurrentSortExpression="Pcode"
AllowPaging="True" onrowcancelingedit="gvList_RowCancelingEdit"
onrowediting="gvList_RowEditing" onrowupdating="gvList_RowUpdating">
<Columns>
<asp:BoundField DataField="TID" HeaderText="外键" SortExpression="TID"
Visible="false">
</asp:BoundField>
<asp:BoundField DataField="Manufacturerse" HeaderText="厂商"
SortExpression="Manufacturerse">
</asp:BoundField>
<asp:BoundField DataField="SolutionTime" HeaderText="平均解决时间"
SortExpression="SolutionTime">
</asp:BoundField>
<asp:BoundField DataField="QuestionNum" HeaderText="问题数量"
SortExpression="QuestionNum">
</asp:BoundField>
<asp:CommandField HeaderText="编辑" ShowEditButton="True" />
</Columns>
</sinopec:SmartGridView>
后台代码:
protected void gvList_RowEditing(object sender, GridViewEditEventArgs e)
{
this.gvList.EditIndex = e.NewEditIndex;
} 展开
前台页面:
<sinopec:SmartGridView ID="gvList" runat="server" AllowSorting="True"
AutoGenerateColumns="False" CurrentSortDirection="Descending"
DataBindHandler="bindgvList" EmptyDataText="没有符合条件的数据" PagerBinding="pagerList"
SortButtonImageFold="~/Images/" Width="100%" CurrentSortExpression="Pcode"
AllowPaging="True" onrowcancelingedit="gvList_RowCancelingEdit"
onrowediting="gvList_RowEditing" onrowupdating="gvList_RowUpdating">
<Columns>
<asp:BoundField DataField="TID" HeaderText="外键" SortExpression="TID"
Visible="false">
</asp:BoundField>
<asp:BoundField DataField="Manufacturerse" HeaderText="厂商"
SortExpression="Manufacturerse">
</asp:BoundField>
<asp:BoundField DataField="SolutionTime" HeaderText="平均解决时间"
SortExpression="SolutionTime">
</asp:BoundField>
<asp:BoundField DataField="QuestionNum" HeaderText="问题数量"
SortExpression="QuestionNum">
</asp:BoundField>
<asp:CommandField HeaderText="编辑" ShowEditButton="True" />
</Columns>
</sinopec:SmartGridView>
后台代码:
protected void gvList_RowEditing(object sender, GridViewEditEventArgs e)
{
this.gvList.EditIndex = e.NewEditIndex;
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询