I have a grid bound to a dataset table which contains a "status" column with integer numbers from 0 to 5. I would like to use a combobox celltype to display this information and map each of the numbers to a textual description. eg.
0 = Lemon
1 = Apple
2 = Bananna
3 = Peach
4 = Orange
5 = Pear
So when the column loads the dropdown is selected at the correct index showing the text description of the underlying numeric value. Then the user can drop the menu down to select a different fruit whereupon the underlying dataset value is changed to its numeric mapping.
ADAdministrator Syncfusion Team June 1, 2004 07:35 AM
You can create a second datatable with 2 columns, one holding 0 - 5 and the other holding lemom through pear. Then set the GridBoundColumn.StyleInfo.DataSource to this DataTable. Also set the DisplayMember and ValueMember for this same combobox column in your grid. Here is a little sample.
ADAdministrator Syncfusion Team June 1, 2004 08:06 AM
Just as an aside is there a way to achive the same result without creating a second datatable?
ADAdministrator Syncfusion Team June 1, 2004 10:44 AM
You do have to create some type of datasource for your combobox with two public properties in it. It does not have to be a DataTable, but it does have to have the two properties. So, you could use an ArrayList of objects with two public properties, or some list that implemented ITypedList, or ???