2012-05-04 6 views
1

자동 생성 column = true로 그리드보기를 사용 중입니다. 내가 그리드gridview에서 행 업데이트 문제

protected void UpdateRecord(object sender, GridViewUpdateEventArgs e) 
    { 
    TextBox tPropertyId = (TextBox)row.FindControl("PropertyId"); 
    } 

를 업데이트하고 언제 called.The proplem 내가 tPropertyId.Text을하고있는 중이 야 때, tPropertyId 내가 null 참조 예외를 얻고, null 값을 받고 있다는 것이다지고.

도와주세요.

+0

무엇인가'row'을 시도하십시오? ['GridViewUpdateEventArgs.NewValues'] (http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridviewupdateeventargs.newvalues.aspx) 속성을 살펴보십시오. –

답변

0

protected void UpdateRecord(object sender, GridViewUpdateEventArgs e) 
{ 
    if (e.Row.RowType != DataControlRowType.Footer) return; 
    TextBox textBox = new TextBox(); 
    e.Row.Cells[0].Controls.Add(textBox); 
}