This is a migrated thread and some comments may be shown as answers.

Problem to make disappear GridTempleColumn but ONLY for some lines

1 Answer 29 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Adigard
Top achievements
Rank 1
Adigard asked on 09 Nov 2011, 09:34 AM
I have a complex problem:

I have in my Grid a GridTemplatecolumn which displays the text " rapport " but this text must be visible only for some lines

The condition to enable or disable the visibility is within the second if

protected void GridDisplayOldRDV_ItemDataBound(object sender, GridItemEventArgs e)
{
 
    HiddenField HiddenFieldIdParticipant = e.Item.FindControl("HiddenFieldIdParticipant") as HiddenField;
    Utilisateur utilisateur = (Utilisateur)Session["utilisateur"];
    if (HiddenFieldIdParticipant != null)
    {
         if (utilisateur.idUtilisateur.ToString() != HiddenFieldIdParticipant.Value.ToString())
        {
            GridDisplayOldRDV.MasterTableView.GetColumn("Debriefing").Visible = false;
        }
    }
}


Right now , my problem is with this line :
GridDisplayOldRDV.MasterTableView.GetColumn("Debriefing").Visible = false;

The column disappears everytime...

I hope i'm clear enough

Thanks in advance for your help

1 Answer, 1 is accepted

Sort by
0
Adigard
Top achievements
Rank 1
answered on 09 Nov 2011, 09:49 AM
I solved my problem myself doing this :

DebriefingRDV.Visible = false;

DebriefingRDV is the ID of the Hyperlink(in my scenario) which is in the Grid TemplateColumn




Tags
Grid
Asked by
Adigard
Top achievements
Rank 1
Answers by
Adigard
Top achievements
Rank 1
Share this question
or