0

Attachment: file.
I am writting some code to show images. This code is written in Form_Load event.
But I am unable to see images. If form is shown without MDI parent, it works fine. But when I set MDI Parent then it doesnt show images.
I moved the code to activate event of form But it shows images after 2/3 seconds.
Could anybody elaborate solution/reason?

2
Contributors
2
Replies
4
Views
8 Years
Discussion Span
Last Post by nilesh.kalyanka
0

Don't assign a value to each cell.

private void Form1_Load(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();
            for (int i = 1; i <= 100; i++){
                dt.Columns.Add("i"+i, typeof(Image));
            }
            for (int i = 1; i <= 100; i++){
                DataRow r = dt.NewRow();
                for (int j = 0; j < 100; j++){
                    r[j] = imageList1.Images[1];
                }
                dt.Rows.Add(r);
            }
            dataGridView1.DataSource = dt;
        }
0

Thanks for instant reply. But due to some reasons, I am unable to store images in datatable. There are multiple functionalities on grid like drag drop, move, copy etc. Is there any other way to get rid of this problem?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.