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

ComboBox CellValue problems

Thread ID:





1795 Nov 27,2002 04:56 AM UTC Dec 4,2002 04:43 AM UTC WinForms 3
Tags: GridControl
Kai Iske
Asked On November 27, 2002 04:56 AM UTC

Hi, I'm currently playing around with ComboBox CellTypes and want to have control over what is happening to the Cell's value. This is what I do: - Create an array of objects (ID/Name properties available) and assign to DataSource - Set DisplayMember (Name) and ValueMember (ID) - Set CellValue to the ID of the currently selected item - Set ExclusiveChoiceList to true This works like a charm. Now, I want to track changes to the selection: - Trap CurrentCellChanged Event and read the new CellValue of the current cell. This is where the problem starts: The ComboBox Model/Renderers never ever set the CellValue/ControlValue. Only the ControlText will be changed. Looking through the Source Code of the Grid and the Models/Renderers show that the CellValue will only be used to initialize the current selection of the ComboBox. Thereafter CellValue/ControlValue won't be changed at all. I have created a workaround for this identifying the selected item by its label but I'd prefer getting either the selected index or the selected item's ID (ValueMember) which is actually what I was expecting the ComboBox Model/Renderer to do. In case I'm missing something here, please let me know. Thanks for your help Kai Iske DWS Investments

Administrator [Syncfusion]
Replied On November 27, 2002 10:11 AM UTC

Kai, I don't think you are missing anything. We will modify our code allow you to easily get at the current control value as well as the current control text. Look for this change in the next update. Thanks, Clay

Administrator [Syncfusion]
Replied On December 2, 2002 04:07 PM UTC

Hi, I had the same problem as Kai noted earlier. As a workaround, if you register for "CellsChanged" event, you would get the changed value. Here is a snippet: private void grid1_CellsChanged(object sender, Syncfusion.Windows.Forms.Grid.GridCellsChangedEventArgs e) { Console.WriteLine("Cells changed: " + e.Range); int row = e.Range.Top; int col = e.Range.Left; // Note: Comboboxes does not emit the value until it looses focus // adjust the following row/cols if (col == 3 && (row == 9 || row == 11)) { object newValue = grid1[row,col].CellValue; } } Hope this helps. cheers, - Reddy

Kai Iske
Replied On December 4, 2002 04:43 AM UTC

Hi Reddy, thanks for the information. Will look into this. Maybe this is a hint to the Syncfusion guys as well, as the CellValue actually does get set before calling some Event Handlers. Kai


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