Hello
How to set DataTable source as UltraEditorCombo selected items.
Thanks
Hi,
Yes, this code is looping through the items and selected each one whose text is "ANSWER TEXT", one at a time. In other words, you are setting the Value to a single item, and then potentially setting it to another single item, which will replace the first item.
If you want to select all of the items, you would have to build an array that contains the DataValue of each item and then set the value of the Combo to that array.
Hello Mike .
I try like below , but it only displays just one.Not all .
DataRow[] rows =SourceTable.Select("QUESTION_ID=" + Some.Value.ToString(),""); for (int i = 0; i < rows.Length;i++ ) { foreach (ValueListItem item in editorCombo.Items) { if(item.DisplayText ==rows[i]["ANSWER_TEXT"].ToString()) { editorCombo.Value = rows[i]["ANSWER_TEXT"].ToString(); } } }
Okay. So if the user selects multiple items on the list, then the Value property of the control will return an object array which contains the selected values. So you could store those values and then restore them by looping through the list and checking the items that exist in the array. There's no way to bind this, unless you bind the control's value to a single field that contains the array.
Hello Mike.
The source of UltraComboEditor is another table.User checks items from the UltraComboEditor and saves to Dabatabase.Next time when user wants to see the selected items I need to show the saved items as selected on ultracomboeditor.
Thanks in advance
I'm not sure what you mean by "selected items". You can't set a DataTable as the selected items of a combo. But if you are asking how to have the list populated by a DataTable, then you do it the same way you would for any control - set the DataSource property.