Buttonrendering, datagrid

  • Thread starter Thread starter Albert
  • Start date Start date
A

Albert

Hi all,

When a cell of a datagrid is set to type combobox, it doesnt show the little
dropdown button until the actual cell is clicked. I want the cell to have
the button all the time, also when not clicked. As far as i know, the only
way to do this is to draw your own little button in the cell by using the
rendering.. this works fine, however i have drawn a normal button now, i
want an exact copy of a "combobox-button". Does anyone have any idea how to
accomplish this? The normal button i get using following code.. It is gray,
which should be lightblue and i use a "v" to show on the button, which isnt
ideal either..
Many thanks for any suggestions.

Albert

Dim clickrectangleValue As New Rectangle
With clickrectangleValue

..X = e.Bounds.X + (0.75 * e.Bounds.Width)

..Y = e.Bounds.Top + (0.05 * e.Bounds.Height)

..Width = e.Bounds.Width * 0.25

..Height = e.Bounds.Height * 0.9

End With

ButtonRenderer.DrawButton(e.Graphics, clickrectangleValue, "v", Me.Font,
False, state)
 
Try setting the "DisplayStyleForCurrentCellOnly" (for the column in
question) to "False".
By the way - I'm using a DataGridView NOT a DataGrid so that may make a
difference
 
Back
Top