Mohamed Ahmed

Mohamed Ahmed

  • NA
  • 34
  • 739

DataGridView .bmp not showing

Dec 6 2017 7:53 AM
Hi all,
 
I'm trying to create AutoCAD add-in to preview .bmp files
 
I have snippet code to do the following 
- Tow ListBoxis binded together. the first one show directory and the second show subfolder. 
- DataGridView to show the .bmp files.
  1. private void Form1_Load(object sender, EventArgs e)  
  2. {  
  3.     listBox1.DataSource = Directory.GetDirectories(rootDirectory).Select(Path.GetFileName).ToList();  
  4.     listBox1.SelectedIndexChanged += ListBox1_SelectedIndexChanged;  
  5.     listBox2.SelectedIndexChanged += ListBox2_SelectedIndexChanged;  
  6.   
  7.     DataGridViewImageColumn dgvimgcol = new DataGridViewImageColumn();  
  8.     dgvimgcol.ImageLayout = DataGridViewImageCellLayout.Stretch;  
  9.     dgvimgcol.Width = 250;  
  10.     dgvimgcol.HeaderText = "Blocks";  
  11.     dataViewImages.RowTemplate.Height = 300;  
  12.     dataViewImages.Columns.Add(dgvimgcol);  
  13.     dataViewImages.AllowUserToAddRows = false;  
  14.     dataViewImages.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;  
  15. }  
and i got this  
- I need to Set only one colomn (Blocks).
- add double click event to insert the dwg file. 
 

Attachment: Form1.zip