My code is
protected void gwdSearchRating_RowDataBound(object sender, GridViewRowEventArgs e)
{
Image img;
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label lbl_rating = (Label)e.Row.FindControl("lbl_rating");
if (lbl_rating.Text == "") //what is condition here i write if there 0 value i get "NR"
{
lbl_rating.Text = "NR";
}
int rating = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "rating"));
for (int i = 0; i < rating; i++)
{
img = new Image();
img.ImageUrl = "~/Images/Rating_star.gif";
e.Row.Cells[1].Controls.Add(img);
}
}
}
Please help me
Loading


Benjamin KemnerRank #7,492 · 240 reputationPosted Jul 19, 2011, 4:09 AM EDT
if (lbl_rating.Text == null)
{
lbl_rating.Text = "NR";
}
or
if (String.isEmpty(lbl_rating.Text))
{
lbl_rating.Text = "NR";
}
or
if (lbl_rating.Text == "0")
{
lbl_rating.Text = "NR";
}
?!?
sagar Bhosale162 reputationPosted Jul 19, 2011, 4:14 AM EDT
Benjamin KemnerRank #7,492 · 240 reputationPosted Jul 19, 2011, 4:19 AM EDT
Dinesh BeniwalRank #9 · 64K reputationPosted Jul 19, 2011, 4:22 AM EDT
thanks