I want to have a cell that displays a multicolumn combo box.
The combo should display a key and a description in separated columns.
When the user selects an item from the combo, the key should go in the current cell (the one with the combo), while the description should go in the cell next to the current one, so that the grid now displays the key and the description in two columns.
I was unable to find a sample that addressed my need.
Could you please help?
ADAdministrator Syncfusion Team September 28, 2004 04:45 AM
You can use the "GridListControl" cell type to display a multicolumn combobox. To make the next cell contain one of the column values from the selected item, you can use the CurrentCellCloseDropDown event and set this value there. We ship several samples that show multicolumn dropdowns, including CellTypes\ComboBoxes and Quick Start\CellTypes. Here is the latter sample modified to display the value in the next cell using the CurrentCellCloseDropDown event. The changes to facilitate this are marked with two tic comments. The main change is that if you do not set the ValueMember for the style of the COmboBox cell, then the grid will treat the actual object as the cell value, and this lets you easily access any properties of the object for your use (setting the next cell to something). This samples uses an arraylist of objects as the data source, the same idea should work with a DataTable data source for the combobox.
RRRaul RosenthalSeptember 28, 2004 05:45 AM
With your help I was able to get my code working in no time.
You''re right, there were indeed some samples that could have helped.
To my excuse I can only say that I have to add a new feature to an application before 6 PM today and I was a bit in a hurry.