TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sagar Bhosale
NA
167
146.4k
If there is 0 value in gridviwe how to display in the form 'NR'
Jul 19 2011 8:01 AM
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
Reply
Answers (
4
)
Open webform with jquery as a popup
How to unload the gridview in asp.net