'Display an image directly to a picture box from datagridview

I'm trying to make a program that replaces the images from a folder, from stored images embedded into resources and conserving their original name. The issue I'm facing is to display the image to a picture box so the users know what he is replacing since the files name are randomized.

My datagridview code to retrieve the files name from the specific folder:

string[] files = Directory.GetFiles(@Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\Black Desert\\FaceTexture", "*", SearchOption.TopDirectoryOnly);
        DataTable table = new DataTable();
        table.Columns.Add("File Name");
        for (int i = 0; i < files.Length; i++)
        {
            FileInfo file = new FileInfo(files[i]);
            table.Rows.Add(file.Name);

        }
        dataGridView1.DataSource = table;

It looks like that:Picture

Where the red square is, I'd like depending on which row is selected in the Gridview the image being displayed here.

And do the same with the stored images into resources.

however I'm unable to retrieve the files from resources aswell:

here's my code and his picture: Picture

 string[] files2 = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceNames();

        DataTable table2 = new DataTable();
        table2.Columns.Add("File Name");
        for (int i = 0; i < files2.Length; i++)
        {
            FileInfo file = new FileInfo(files2[i]);
            table2.Rows.Add(file.Name);

        }
        dataGridView2.DataSource = table2;


Solution 1:[1]

First part of my question was answered by myself using that portion of code:

   private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
    {
        try
        {
            
            pictureBox1.Image = Image.FromFile(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\Black Desert\\FaceTexture\\" + dataGridView1.SelectedCells[0].Value.ToString());
           
        }
        catch (Exception ex)
        {
            //MessageBox.Show(ex.Message);
        }
       
    }

I'am still trying to retrieve the images from the resources though.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 LearningHow2Code