In a project I want a combobox to filter the rows according to the text written there. (overriten class of combobox). I am performing it simply as below:
private void Cmb1_TextUpdate(object sender, EventArgs e)
{
if (isFound(Cmb1.Text)) //if text is not found in dataTable then false
dataTable.DefaultView.RowFilter = string.Format("Name LIKE '%{0}%'", Cmb1.Text);
}
It filters the results. But for example if there is 1 element left after filtering dropdown height decreases to fit the text. It is okey until now. But after I delete filter text items come back but dropdown height is not changing (still in a height value for 1 item). To fix it I need to unfocus and focus again so it refreshes.
I tried to write this.DropDownHeight = value;
at the end of Cmb1_TextUpdate
and also override the OnDropDown event
I tried enter link description here subject already but no luck (I think refresh works there but for me not):
NOT: It works when I add these:
DroppedDown = false; DroppedDown = true;
but slows down working of combobox