Mayank
Mayank

Reputation: 8852

Check where the event is coming from

I have a external device which sends events to the UI and I change UI according to that. Also I can change UI can send data back to the device. The problem is when device sends update I need change the index of the combo box programmatically but when I do that the SelectedIndexChanged event fire's. I only want that event to fire when I changed the ComboBox from UI itself not programmatically.

Edit

            if (index > 0 && index < cboHeatPoints.Items.Count)
            {
                //cboHeatPoints.SelectedIndex = index;
            }

Upvotes: 1

Views: 71

Answers (1)

Jeff
Jeff

Reputation: 7674

Use SelectionChangeCommitted instead of SelectedIndexChanged.

Upvotes: 2

Related Questions