开发者

Asp.net grid view

I am nt able to edit the details in gridview. When i click o开发者_Python百科n Edit link(Command Field), row editing event is fired but when i click on update link , row editing event is fired again and update event is not getting fired at all.

Any suggestions ??


Sample Code: May be you should try using debugger and check. Here i have given an example for you.

  protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {

        // Retrieve the row being edited.
        int index = GridView1.EditIndex;
        GridViewRow row = GridView1.Rows[index];
        TextBox t1 = row.FindControl("TextBox1") as TextBox;
        TextBox t2 = row.FindControl("TextBox2") as TextBox;
        string t3 = GridView1.DataKeys[e.RowIndex].Value.ToString();

        lblMsg.Text = "Updated record " + t1.Text + "," + t2.Text + "Value From Bound Field" + t3;
    }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜