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#.
Vipan SharmaPosted Feb 25, 2016, 4:59 AM
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 !!!!
Amit Kumar SinghPosted Feb 25, 2016, 3:38 AM
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;
}
}
}