Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
545
Combobox - Detect User Change...
posted

I have a grid that lists records and below that a detail of the record displayed.  The grid and the detail are  linked to the same datasource.  This detail has combo boxes displaying the values corresponding to the values in the grid.

What is the best way to detect that a USER has selected a DIFFERENT value from the combo list?  I can't use TextChanged() or ValueChanged() because these events get fired by simply scrolling through records in the grid.  The regular WinForm combo box has events,  SelectedItemChanged() and SelectedValueChanged() in addition to TextChanged() and ValueChanged() but I don't see anything comparable for the UltraCombo.  So far, I have resorted to using CloseUp() but this does not necessarily mean a different value was changed by the user.

Basically, I need to activate a "Save" button on my detail if the user changes any value on the form.

Thanks,

--Mark

Parents
No Data
Reply
  • 469350
    Offline posted

    Hi Mark,

    What kind of DataSource are you binding to? If you are using a DataSet/DataTable, then there is build-in support on those objects to track changes and you could enable your save button based on whether there are any pending changes. 

    Another option is for you to trap the ValueChanged event of the Combo and simply compare the combo's current Value with the Value of the underlying field in the data source.

Children