2010-03-26 87 views
1

我無法編輯gridview中的細節。 當我點擊編輯鏈接(命令字段)時,行編輯事件被激發,但當我點擊更新鏈接時,行編輯事件再次被激發,並且更新事件根本沒有被觸發。Asp.net網格視圖

有什麼建議?

+2

您可以先顯示代碼的相關部分。 – 2010-03-26 08:04:30

+0

Hi Manoj,Darin是對的,請發佈更多信息或聯繫DevExpress支持團隊:http://www.devexpress.com/Support/Center/CreateIssue.aspx?issuetype=Question – Mehul 2011-08-02 04:20:28

回答

1

示例代碼: 可能是你應該嘗試使用調試器並檢查。 在這裏我給你一個例子。

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; 
    }