Re: ASP.NET Data Controls Hi,
Try this then.
The code is to be written on the OnEditing Event of the Gridview1 since u want to modify EditTemplates
foreach(GridViewRow gr in GridView1.Rows)
{
if (((Label)gr.FindControl("lblUserStatus")).Text=="a dmin")
{
((Label)gr.FindControl("lblUserName")).Visible=fal se;
((LinkButton)gr.FindControl("lnkbtnUserName")).Vis ible=true;
}
else
{
//viceversa
}
}
Assuming that u have a filed in gvw to distinguish admin. if no creat one and make its visible="false". it will be simpler
regards
__________________ H2O
Without us, no one can survive.. |