首页 新闻 会员 周边 捐助

gridView编辑列事件

0
[已关闭问题] 关闭于 2010-01-27 10:11

我在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;

    }

忽然明白的主页 忽然明白 | 初学一级 | 园豆:80
提问于:2010-01-13 09:54
< >
分享
所有回答(2)
0

你用的是SmartGridView

请查看对应的属性设置或API

邀月 | 园豆:25475 (高人七级) | 2010-01-13 11:18
0

this.gvList.EditIndex = e.NewEditIndex;后面重新绑定一次

齐.net | 园豆:1421 (小虾三级) | 2010-01-18 10:31
对,是这样的。
支持(0) 反对(0) 忽然明白 | 园豆:80 (初学一级) | 2010-01-20 10:33
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册