Data Grid

A

Avi R

Hi,
I'm trying to insert tictureBox in Datagrid I use the next code :


System.Windows.Forms.DataGrid datagrid1; //my datagrid
DataGridTextBoxColumn datagridtextBox; //to add my picture box


//Take the text box from the second column of the grid where I will be
adding the controls (PictureBox)
datagridtextBox = (DataGridTextBoxColumn)datagrid1.TableStyles[0].GridColumnStyles[1];


//to add my pictureBox in datagridtextBox (second column in my
datagrid)
for(int i = 0 ;i < dataTable.Rows.Count ; i++)
{

datagridtextBox.TextBox.Controls.Add(pct);
pct.BringToFront();

}

that work fine but the picture box appeare only when i click on the
cell.
If someone know what i can do to show the picture box when loading the
datagrid without click,
please let me know.

Thanks
Avi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top