We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Multicolumn combo in grid

Thread ID:





19503 Sep 28,2004 08:17 AM UTC Sep 28,2004 09:45 AM UTC WinForms 2
Tags: GridControl
Raul Rosenthal
Asked On September 28, 2004 08:17 AM UTC

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? Thanks. Raul Rosenthal SDB SpA

Administrator [Syncfusion]
Replied On September 28, 2004 08:45 AM UTC

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. VB_4145.zip

Raul Rosenthal
Replied On September 28, 2004 09:45 AM UTC

Thank you. 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. Thank you. Regards, Raul Rosenthal SDB SpA


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon