Jun 02, 2011, 11:00 AM
In edit mode how to assign selected values in MultiCombo
Hello guys
In my application most of the pages i used
It is working fine in add mode. While in edit mode i cannot assign selected values to that combo box. I can achieve that by using server side coding only.
But in most of the times selected values are vanished. i am assigning values to that combo box in
Store:
If above mentioned information not clear means please let me know.
Thanks in advance.
In my application most of the pages i used
<ext:MultiCombo>
But in most of the times selected values are vanished. i am assigning values to that combo box in
Page_Load(object sender, EventArgs e)
event. once i clicked the combo box trigger means selected values are showing. Below mentioned code snippets i used.Store:
<ext:Store ID="dsPackType" runat="server" AutoLoad="false" ShowWarningOnFailure="true">
<Proxy>
<ext:HttpProxy Url="/Lookup/GetPackType/" Timeout="6000000" />
</Proxy>
<Reader>
<ext:JsonReader IDProperty="ID" Root="data" TotalProperty="total">
<Fields>
<ext:RecordField Name="ID" />
<ext:RecordField Name="VALUE" />
</Fields>
</ext:JsonReader>
</Reader>
<BaseParams>
<ext:Parameter Name="Type" Value="1" />
</BaseParams>
<Listeners>
<LoadException Handler="var win = winError;win.show();" />
</Listeners>
<SortInfo Field="VALUE" Direction="ASC" />
</ext:Store>
Page_load event: (Server side)
var packtypeAll = editpdrraactivecontroller.GetPackTypeIDs(Convert.ToInt32(ViewData["id"].ToString()));
if (packtypeAll != null)
{
StringBuilder selectGroupName = new StringBuilder();
this.cboPackType.SelectionMode = MultiSelectMode.All;
foreach (var item in packtypeAll)
{
SelectedListItem list = new SelectedListItem();
list.Value = item.PACKTYPEID.ToString();
this.cboPackType.SelectedItems.Add(list);
}
}
Client Side:<ext:MultiCombo ID="cboPackType" StoreID="dsPackType" runat="server" Resizable="true"
Width="200" ListWidth="200" ValueField="ID" DisplayField="VALUE" MsgTarget="Side">
</ext:MultiCombo>
Kindly help me how to achieve this in JavaScript code or which server side event i have to use.If above mentioned information not clear means please let me know.
Thanks in advance.