I'm using ComboBox
to keep data in. Usually i create 2 ComboBox
one hidden to keep ID and one with the real data. I need id to know which id it is in database. I then use SelectedIndex and event for both checkboxes to keep them in sync. Sometimes I even use more comboboxes and keep them all in sync with each other using SelectedIndex and lots of events. I have a feeling there's a better way.
private void czynnoscInstrumentyFinansoweComboID_SelectedIndexChanged(object sender, EventArgs e) {
czynnoscInstrumentyFinansoweCombo.SelectedIndex = czynnoscInstrumentyFinansoweComboID.SelectedIndex;
}
Also another thing that I would like to have is autocomplete/search inside ComboBox
. When user uses combobox and starts typing inside combobox it just reacts on first letter so when you type 'start' it will jump thru the list to s
then to t
then to a
etc. when i would like it to try and find the phrase "Start of something".
How do I achieve both of those?
EDIT:
I am not using DataSets, and i am adding values like that:
// get sql data and put it into strings/decimals then add it like that to comboBox
string var = "sds";
czynnoscInstrumentyFinansoweComboID.Add(var);