Bonjour,
Je veux afficher dans une colonne de GRIDVIEW une image en fonction des valeurs des champs.
Voici mon code, mais il m'affiche pas l'image.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            GridViewRow Lgn = e.Row;
            string nom;
            nom = DataBinder.Eval(Lgn.DataItem, "ENAME").ToString();
            ImageButton imagePos = Lgn.FindControl("ImageButton2") as ImageButton;
 
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
 
                if (nom == "JONES")
                {
                    imagePos.ImageUrl = "~/Images/en_cours.bmp";
 
                }
 
 
            }
Merci d'avance.