My Gridview as follows
Select Course Startdate Enddate
Clickhere(Link Button) REO 10 May 2015 15 May 2015
Clickhere(Link Button) 20 May 2015 25 May 2015
Clickhere(Link Button) 28 May 2015 31 May 2015
Select Course Startdate Enddate
Clickhere(Link Button) REO 10 May 2015 15 May 2015
Clickhere(Link Button) 20 May 2015 25 May 2015
Clickhere(Link Button) 28 May 2015 31 May 2015
how to visibe false the link button for 2nd row and third row in Gridview.
Because Whenever the Course value is empty in gridview. i do not want the link button.
for that how can i do in asp.net using c#.
Because Whenever the Course value is empty in gridview. i do not want the link button.
for that how can i do in asp.net using c#.

Amit Kumar SinghRank #562 · 4.3K reputationPosted Feb 24, 2016, 10:38 PM EST
if (e.Row.RowType == DataControlRowType.DataRow
{
LinkButton lnkEditPlanning = (LinkButton)e.Row.FindCont
Label lblType = (Label)e.Row.FindControl("
if (lblType != null && lnkEditPlanning != null)
{
if (lblType.Text.ToLower() == "posting")
{
lnkEditPlanning.Visible = true;
}
else
{
lnkEditPlanning.Visible = false;
}
}
}
Vipan SharmaRank #1,589 · 999 reputationPosted Feb 24, 2016, 11:59 PM EST
It's a trick. I have used many time with the help of Ternary operator. Its work for me.
Set Visible true false of link button.
Note: Make Sure Syntax of link button is correct. I have not check syntax.
Kindly let me know if any help required.
Accept if it will help you
Happy Coding !!!!