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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ComboBox + Arraylist <-- Object

Thread ID:





8079 Oct 20,2003 11:25 AM UTC Oct 21,2003 08:20 AM UTC WinForms 4
Tags: GridControl
Boris Jansen
Asked On October 20, 2003 11:25 AM UTC

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 12:05 PM UTC

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 21, 2003 03:27 AM UTC

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 08:00 AM UTC

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 08:20 AM UTC

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?


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