Can't Get ComboBox To Show Anything In A DataGridView

I've wasted an entire day trying to figure this out. Something I thought would be simple behavior.


I have a collection of objects that I am binding to a DataGridView (an LLBLGenPro EntityCollection for those familiar). This collection is a graph of tables: Employee, EmployeeDepartment, Department.

My objective is to bind the Employee table to the DataGridView, and then bind the Department names to a ComboBox in the DataGridView (this may sound odd, but in our particular case an Employee's budget can be split between multiple Departments).

To ensure my EntityCollection was returning the full graph and that databinding was working I setup a master-detail pair of DataGridViews. This works just fine - I see the Employee data in the master table and the Department data in the detail table, so I know the entire graph of objects is being returned and the DataGridView is binding fine.

What I cannot get to happen is have anything bind to the ComboBox.

But that's not what's really pathetic. I can't even set a default Item collection of strings for my ComboBox. Absolutely nothing shows up in the ComboBox when I run the application. I've tried creating ComboBoxColumns at runtime, I've tried a different DataGridView... Nothing works. As of right now it appears that the ComboBox cannot hold any data of any kind, or at least it can't display it. Is my version of the .NET framework broken

Does anyone have a simple sample on how to bind data to a ComboBox in a DataGridView column I could use anything here. And please - no "drag and drop" designer binding solutions. I have to do this programatically, so the visual designer responses that are all over this message board are of absolutely no use to me.




Answer this question

Can't Get ComboBox To Show Anything In A DataGridView

  • Omicron

    Wierd.

    I finally deleted the datagridview and started over from scratch and now it works...

  • Can't Get ComboBox To Show Anything In A DataGridView