dyowee

Good day to all! =)

I tried to follow the example here http://blogs.msdn.com/jfoscoding/archive/2005/03/03/384430.aspx for hosting a treeview in a DataGridViewCell. The problem is that if the treeview has focus, clicking on the dropdown button once does not close the dropdown. I need to click it again to successfully close it. I hope you can help me out. Thanks.



Re: Windows Forms Data Controls and Databinding Problem with ToolStripDropDown in DataGridViewCell

Ken Tucker

The datagridview shows a picture of the cells editing control when you are not editing it. So the first click shows the editing control and the second actually hides the drop down. Maybe you can try something like to get the drop down to close on the first click

http://www.vb-tips.com/dbpages.aspx ID=9bc438e8-35da-4b05-98be-3ec7520240dd





Re: Windows Forms Data Controls and Databinding Problem with ToolStripDropDown in DataGridViewCell

dyowee

The only workaround I have found for now is to disable the combobox when the treeview is showing so that there's no flicker. I really can't find a good solution. Is it possible to disable a combobox while retaining the color of the textarea and the dropdown button Thanks.



Re: Windows Forms Data Controls and Databinding Problem with ToolStripDropDown in DataGridViewCell

ZW2

Yes, you can! The main work steps are

1:Change combox DrawMode property

2:Handle MeasureItem and DrawItem events, and the ItemHeight property

You can refer MSDN Library topic: http://msdn2.microsoft.com/en-us/library/system.windows.forms.combobox.measureitem.aspx





Re: Windows Forms Data Controls and Databinding Problem with ToolStripDropDown in DataGridViewCell

ZW2

Here is no way to disable a ComboBox while retaining the color of the textarea and the dropdown button. But we can use owner draw to solve the problem.

1:Change combox DrawMode property

2:Handle MeasureItem and DrawItem events, and the ItemHeight property

You can refer MSDN Library topic: http://msdn2.microsoft.com/en-us/library/system.windows.forms.combobox.measureitem.aspx