views:

21

answers:

1

I am trying to create a gridview with a string column, a checkbox column, and a dropdownlist/combobox column. The first two are finished (all code behind), just need help with the last one.

DataTable dt = new DataTable("tblAir");
            dt.Columns.Add("Flight Details", typeof(string));
            dt.Columns.Add("Prefered Seating", typeof(bool));
            //doesn't work 
            dt.Columns.Add("Add Remark", typeof(ComboBox));

The data for the combobox is being supplied on load as we cannot work with a database.

+2  A: 

Peter Bromberg has a detailed article on creating a Winforms gridview with comboboxes:

http://www.eggheadcafe.com/articles/20060202.asp

Dave Swersky
having some trouble trying to figure it out, I have the DataGridComboBoxColumn class, not sure how to populate the comboBox or how to add it to my dt.Columns...- basically I need to populate a DataTable with my choices, unsure how to do that, as that explain it just used with a database
Spooks
need for datagridview, that link is for datagrid...
Spooks