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.
Unfortunately, activation email could not send to your email. Please try again.

ComboBox + Arraylist <-- Object

Thread ID:

Created:

Updated:

Platform:

Replies:

8079 Oct 20,2003 07:25 AM Oct 21,2003 04:20 AM Windows Forms 4
loading
Tags: GridControl
Boris Jansen
Asked On October 20, 2003 07:25 AM

Hallo! I have a little problem. Column 6 (for example) have a ColStyles ComboBox. The Datasource for this Column is an Arraylist. This Arraylist contains a object with two values (id and text). now the problem ;-) Set the Datasource, Dosplaymember and Valuemember. mygrid.ColStyles(6).DataSource = MyArraylist mygrid.ColStyles(6).DisplayMember = "text" mygrid.ColStyles(6).ValueMember = "id" the combobox shows me now the Member "text" OK! it work. but if i change the comboboxitem, the valuemeber is every time "id". example: selection --> car ("text") --> return "id" and not (2) selection --> plane("text") --> return "id" and not (3) can you help me? thanks a lot. (sorry! my english is not so beautiful)

Administrator [Syncfusion]
Replied On October 20, 2003 08:05 AM

Hallo Boris, When you want to determine the value that was selected you need to check the style.CellValue property, not the style.ValueMember. style.CellValue will have the id value (2) style.FormattedText will have text (e.g. "plane") Stefan

Boris Jansen
Replied On October 20, 2003 11:27 PM

Thanks, but is doesn`t work. if i ask for the cellvalue, the grid returns me the text inside the cell (e.g. "bike") but not the id. any idea! Thanks a lot. Boris

Administrator [Syncfusion]
Replied On October 21, 2003 04:00 AM

It should ... Try take a look at the sample in Grid\Samples\CellTypes\ComboBoxCells. You can modify it and send me your code changes. Then I can take a look what might be wrong. Stefan

Administrator [Syncfusion]
Replied On October 21, 2003 04:20 AM

Attached is a minimal sample that I think is set up the way you described. If you set a value in cell 1,1, and then click the button, it seems to chow the CellValue and FormattedText as expected. What are you doing differently?

CONFIRMATION

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.

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.

;