because I do not get the image in the datagridview cell in c #

0

happens that I have a list of employees in which they can be those who are high and those who are low then what I tried is to change the image of a cell depending on the state they are using the resource try with this

    dg_Empleado.Rows[p].Cells["Eliminar"].Value = Properties.Resources.reload_webpage_icon_icons_com_53905;

and on the web I found this to add

 private void dg_Empleado_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
    {
        switch(dg_Empleado.Columns[e.ColumnIndex].Name)
        {
            case "Eliminar":
                if(e.Value!=null)
                {
                    try
                    {
                        e.Value = Image.FromFile(e.Value.ToString());
                    }
                    catch(System.IO.FileNotFoundException w)
                    {
                        e.Value = null;
                    }
                }
                break;
        }
    }

but still the image does not come out

    
asked by Rodrigo Torrico 12.01.2018 в 17:37
source

0 answers