18 November 2008

How to get datakeyNames ( Gridview )

GridViewRow row = ((GridViewRow)((Control)e.CommandSource).Parent.Parent);

lblPopGRNNo.Text = grvGRNList.DataKeys[row.RowIndex]["GrnNumber"].ToString();

lblGRNDate.Text = (Convert.ToDateTime(grvGRNList.DataKeys[row.RowIndex]["GrnDate"])).ToString("dd MMM yyyy");

lblSupplierName.Text = grvGRNList.DataKeys[row.RowIndex]["SupplierName"].ToString();

lblSuratJalanNumber.Text = grvGRNList.DataKeys[row.RowIndex]["SuratJalanNumber"].ToString();

No comments: