自己创建以个 ComboBox的继承类,实现在他的下拉列表中显示一张表(datagrid)
class GridCombobox:ComboBox
    {
        private const int WM_LBUTTONDOWN = 0x201, WM_LBUTTONDBLCLK = 0x203;
        ToolStripControlHost gridviewHost;
        ToolStripDropDown dropDown;
        public GridCombobox( )
        {
            
            DataGrid datagrid = new DataGrid();
            datagrid.BorderStyle = BorderStyle.None;
            datagrid.ColumnHeadersVisible = false;
            datagrid.DataSource = mypublic.datatable;//这句已经把datagrid与数据源连接起来,而且数据源有正确的数据
            datagrid.BackgroundColor = Color.White;
            gridviewHost = new ToolStripControlHost(datagrid);
            dropDown = new ToolStripDropDown();
            dropDown.Width = this.Width;
            dropDown.Items.Add(gridviewHost);
        }
       public DataGrid DataGrid
        {
            get { return gridviewHost.Control as DataGrid; }
        }
        private void ShowDropDown()
        {
            if (dropDown != null)
            {
                gridviewHost.Size = new Size(DropDownWidth - 2, DropDownHeight);       
               dropDown.Show(this, 0, this.Height);
            }
        }
    }
但是我在一个Form上创建了类GridCombobox的一个对象,这个对象的下拉列表中总是没有数据呢??????