29 September 2008

GridView-Row Identification In TemplateField ( TextBox )

//Getting gridview row in textchange of template field
protected void txtGrnQuantity_TextChanged(object sender, EventArgs e)
{
TextBox txtGrnQuantity = (TextBox)grvGRN.Rows[((GridViewRow)((TextBox)sender).Parent.Parent).RowIndex].FindControl("txtGrnQuantity");
TextBox txtRejectedQuantity = (TextBox)grvGRN.Rows[((GridViewRow)((TextBox)sender).Parent.Parent).RowIndex].FindControl("txtRejectedQuantity");
}

No comments: