Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Drawing a combobox control on a datagridview with ToolTip - height problem

$
0
0

My problem is that after clicking on the cell of the datagridview control it calls a ComboBox drop-down list. Everything was ok until I added my own drawing model - the problem is with the ComboBox control - its height is smaller than the height of the DataGridView cell. How to set ComboBox height to - dataGridView1.Rows[e.RowIndex].Cells[1].ContentBounds.Height?

myComboBox.DrawMode = DrawMode.OwnerDrawFixed;

myComboBox.DrawItem += (src, ev) =>
{
  ev.DrawBackground();
  //code...                              
  ev.DrawFocusRectangle();                             
};

This code don't work:

myComboBox.Height = dataGridView1.Rows[e.RowIndex].Cells[1].ContentBounds.Height;





Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>