PDA

View Full Version : [CLOSED] Multicombo value set by the database



ucaneto
Apr 29, 2015, 8:49 PM
Hello All

I have tried using multicombo and set values via the database, already tried several codes and could not.

Aspx file


<ext:MultiCombo
runat="server"
Width="640"
ID="cmbProcuracao"
Editable="false"
DisplayField="RazaoSocial"
Delimiter=","
ValueField="Id"
QueryMode="Remote"
ForceSelection="true"
TriggerAction="All"
StoreID="strProcuracao"
AllowBlank="true"
EmptyText="Selecione...">
<Listeners>
<Expand Handler="this.getStore().reload();" />
</Listeners>
</ext:MultiCombo>


In Code Behind




cmbProcuracao.SelectedItems.Add(new Ext.Net.ListItem("13"));
cmbProcuracao.SelectedItems.Add(new Ext.Net.ListItem("2"));


And Not Set Value in multicombo

I tried also


Ext.Net.ListItem list = new Ext.Net.ListItem();
list.Value = "2,13,15";
cmbProcuracao.SelectedItems.Add(list);


I thank those who could help me

Ulisses

ucaneto
Apr 30, 2015, 3:00 PM
Hello


I found the problem, put the code below and it worked.



cmbProcuracao.SelectedItems.Add(new Ext.Net.ListItem() { Value = "13" });
cmbProcuracao.SelectedItems.Add(new Ext.Net.ListItem() { Value = "2" });
cmbProcuracao.SelectedItems.Add(new Ext.Net.ListItem() { Value = "15" });
this.cmbProcuracao.UpdateSelectedItems();




You can close the Post