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
narasiman rao
NA
519
767.3k
Link button should be visble false in gridview
Feb 27 2016 2:39 AM
I have grigview as follows
Course Code Days Startdate Enddate
Clickhere(Link Button) ASM 5 05 May 2016 10 May 2016
Clickhere(Link Button) 12 May 2016 17 May 2016
Clickhere(Link Button) 21 May 2016 25 May 2016
I dont want 2nd row and third row link button in gridview because in gridview
Code(2nd column) second and thrid row code is empty.
Whenever empty in Code i do not want link button. i want to set visble false.
for that my code as follows in Gridview row databound
protected void gvRank_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton lnk= (LinkButton)e.Row.FindControl("LinkButton2");
TextBox text = (TextBox)e.Row.FindControl("Code");
if (text == null && lnk == null)
{
lnk.Visble = false;
}
else
{
lnk.Visible = True;
}
}
}
But in gridview output i get as follows
Course Code Days Startdate Enddate
ASM 5 05 May 2016 10 May 2016
12 May 2016 17 May 2016
21 May 2016 25 May 2016
In course column all the link button are visible false. i want only the second row and third row link button only visible false.
Reply
Answers (
2
)
Getting string value from stored procedure and diplay in C#
write results to csv file