The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
ADAdministrator Syncfusion Team 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.
SDStuart DentAugust 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