编辑一行.NET GridView

时间:2011-07-21 15:08:14

标签: c# asp.net gridview

我有一个绑定到DataTable的Gridview ......

<asp:GridView ID="GridView1" runat="server" CssClass="datatable" CellPadding="0"
BorderWidth="0px" GridLines="None" OnRowCancelingEdit="GridView1_RowCancelingEdit"
OnRowEditing="GridView1_RowEditing" OnRowUpdating="GridView1_RowUpdating" datakeynames="IBNR_Review_Line_Id">
<Columns>
    <asp:CommandField ShowEditButton="True" EditImageUrl="../Style/Images/Edit.gif" ButtonType="Image"
        UpdateImageUrl="../Style/Images/Update.gif" CancelImageUrl="../Style/Images/Cancel.gif">
    </asp:CommandField>
</Columns>
<PagerStyle CssClass="pager-row" />
<RowStyle CssClass="row" />
<PagerSettings Mode="NumericFirstLast" PageButtonCount="7" FirstPageText="«" LastPageText="»" />

...我正在尝试允许RowEdit进入。问题是,当我点击编辑按钮时,我会看到空文本框。

    protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
    {
        GridView1.EditIndex = e.NewEditIndex;
        BindGridView(Convert.ToInt32(ConfigurationTypeList.SelectedValue));
    }

我错过了什么?

0 个答案:

没有答案