How do I create DataGridViewComboBoxColumn that has a grid-like drop down?
I am in need of a DataGridViewComboBoxColumn that displays a multi-column grid drop down, similar to the one described here. Basically, I need to override the DropDown event of the underlying ComboBox. The example at the bottom of this page shows how I can add event handlers. But, I need to override the showing of the drop down. I'm guessing I need to开发者_如何学编程 create my own ComboBox class but how do I connect that with a DataGridViewComboBoxColumn? Has anyone done something similar?
This looks like a winner
.NET datagrid is a graphical user interface component that presents a tabular view of data. .NET datagrid supports the following common interface features:
- Clicking a column header to implement grid sorting
- Dragging column headers to change their size
- In-cell editing of shown data
- Row and column separators, and alternating row background colors
Datagrid's cells can be presented as some different control types (textbox, button, date/time picker etc.) within datagrid interface layout. However much important control is combobox that could be placed in datagrid...
I ended up finding the following on MSDN that outlines how to create a custom DataGridView column. This includes creating a cell type, a column type, and an Editing control type. I ended up using a ListView control inside a form with no borders as my drop down grid.
http://msdn.microsoft.com/en-us/library/aa730881(v=vs.80).aspx
精彩评论