Hello,
I just started to use WinForms 2011 Q3 SP1.
and can't get multicolumncombobox work properly. Please help.
When users type in a letter in multicolumncombobox, I will send a search to web service fetching a list of symbols (together with other info of the symbol) that begin with the typed letter. say, if a user types "A", the search will return symbols begins with "A", like A, A1, AB, ABC, etc. Each symbol has 3 columns, name, description, group.
I subscribe textchanged event, however, it seems it does not work well.
When I type in one letter, it is OK, when I type in two letters say "A", then "B", after I type in "A", cursor goes back to the beginning of text, so it displays "BA".
Also I have to unsubscribe textchanged event and re-sub in the handler, otherwise, the text changed event is triggered endlessly.
I wonder is there a better way?
Thanks
private void radMultiColumnComboBox1_TextChanged(object sender, EventArgs e)
{
var searchText = radMultiColumnComboBox1.Text.Trim();
var url = "https://mysearchURL?substring=" + searchText;
url = SecurityElement.Escape(url);
var request = ServiceBase.GetHttpWebRequestWithHeaderProxy(url, basicAuthorizationEncode64);
var response = request.GetResponse();
Stream streamResponse = response.GetResponseStream();
if (streamResponse != null)
{
var streamRead = new StreamReader(streamResponse);
String strData = streamRead.ReadToEnd();
var resultlist = Deserialise(strData);
radMultiColumnComboBox1.TextChanged -= radMultiColumnComboBox1_TextChanged;
radMultiColumnComboBox1.DataSource = resultlist;
radMultiColumnComboBox1.MultiColumnComboBoxElement.ShowPopup();
radMultiColumnComboBox1.Text = searchText;
radMultiColumnComboBox1.TextChanged += radMultiColumnComboBox1_TextChanged;
}
}
I just started to use WinForms 2011 Q3 SP1.
and can't get multicolumncombobox work properly. Please help.
When users type in a letter in multicolumncombobox, I will send a search to web service fetching a list of symbols (together with other info of the symbol) that begin with the typed letter. say, if a user types "A", the search will return symbols begins with "A", like A, A1, AB, ABC, etc. Each symbol has 3 columns, name, description, group.
I subscribe textchanged event, however, it seems it does not work well.
When I type in one letter, it is OK, when I type in two letters say "A", then "B", after I type in "A", cursor goes back to the beginning of text, so it displays "BA".
Also I have to unsubscribe textchanged event and re-sub in the handler, otherwise, the text changed event is triggered endlessly.
I wonder is there a better way?
Thanks
private void radMultiColumnComboBox1_TextChanged(object sender, EventArgs e)
{
var searchText = radMultiColumnComboBox1.Text.Trim();
var url = "https://mysearchURL?substring=" + searchText;
url = SecurityElement.Escape(url);
var request = ServiceBase.GetHttpWebRequestWithHeaderProxy(url, basicAuthorizationEncode64);
var response = request.GetResponse();
Stream streamResponse = response.GetResponseStream();
if (streamResponse != null)
{
var streamRead = new StreamReader(streamResponse);
String strData = streamRead.ReadToEnd();
var resultlist = Deserialise(strData);
radMultiColumnComboBox1.TextChanged -= radMultiColumnComboBox1_TextChanged;
radMultiColumnComboBox1.DataSource = resultlist;
radMultiColumnComboBox1.MultiColumnComboBoxElement.ShowPopup();
radMultiColumnComboBox1.Text = searchText;
radMultiColumnComboBox1.TextChanged += radMultiColumnComboBox1_TextChanged;
}
}