public void GetLegend() { DataSet ds = objInsp.INSP_Get_RatingLegends(); if (ds.Tables.Count > 0) { grdRatingLegend.DataSource = ds.Tables[0]; grdRatingLegend.DataBind(); //string Legend = "Rating guideline : "; //for (int i = 0; i < ds.Tables[0].Rows.Count; i++) //{ // Legend+=ds.Tables[0].Rows[i]["FromRating"].ToString()+"-"+ds.Tables[0].Rows[i]["ToRating"].ToString()+" "+ ds.Tables[0].Rows[i]["Rating"].ToString()+" "; //} //lblLegend.Text=Legend; for (int i = 0; i < grdRatingLegend.Rows.Count; i++) { grdRatingLegend.Rows[i].Cells[2].BackColor = Color.FromName(grdRatingLegend.Rows[i].Cells[3].Text); } grdRatingLegend.Columns[3].Visible = false; } }