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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Reading Combobox Value in Databound Grid

Thread ID:

Created:

Updated:

Platform:

Replies:

6245 Aug 6,2003 08:23 AM UTC Aug 6,2003 11:23 AM UTC WinForms 2
loading
Tags: GridControl
Stuart Dent
Asked On August 6, 2003 08:23 AM UTC

Hi I'm currently working on a databound grid that must enable/disable certain cells depending on the selected value in a combobox in another cell. When I try to set the Enabled flag for these other cells in QueryCellInfo I've found that the CellValue of the combobox returned from the grid indexer is the previously selected combobox value, not the current one. I do know that after a RowLeave event has fired the correct combobox value is available via the indexer in QueryCellInfo. This behaviour seems a little strange since I know I will always get the correct current value of a checkbox using the indexer from within QueryCellInfo, do comboboxes have to be handled differently? Regards Stuart Dent

Administrator [Syncfusion]
Replied On August 6, 2003 09:39 AM UTC

For most cells, including comboboxes, the changed values are not moved into the grid until the user confirms the change by moving to another cell. For checkboxes, this is not the case. The check is stored whenever the value changes whether or not the cell still has input focus. So, I suspect the problem you are seeing is that the user drops the combobox and makes a selection, but the dependent cell does not change immediately. If you click off the combobox cell, then the dependent cell should change (provided it has to repaint for some reason). If this is the case, then one way to try to get the change to register immediately is to handle the CurrentCellCloseDropDown event, and if the CurrentCell.ColIndex points to your combobox column, then call CurrentCell.ConfirmChanges(). This should force the value to be saved as soon as the combobox closes.

Stuart Dent
Replied On August 6, 2003 11:23 AM UTC

> For most cells, including comboboxes, the changed values are not moved into the grid until the user confirms the change by moving to another cell. For checkboxes, this is not the case. The check is stored whenever the value changes whether or not the cell still has input focus. > > So, I suspect the problem you are seeing is that the user drops the combobox and makes a selection, but the dependent cell does not change immediately. If you click off the combobox cell, then the dependent cell should change (provided it has to repaint for some reason). > > If this is the case, then one way to try to get the change to register immediately is to handle the CurrentCellCloseDropDown event, and if the CurrentCell.ColIndex points to your combobox column, then call CurrentCell.ConfirmChanges(). This should force the value to be saved as soon as the combobox closes. Thanks Clay, I suspect that making the call to ConfirmChanges will solve the problem. Regards Stuart Dent

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.

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

;