View Full Version : [CLOSED] Ext Combobox - Selected value changed from code behind on postback event is not reflected on the UI

Nov 03, 2014, 11:40 AM
I have an Ext.Net combobox. I am using version 2 of Ext.Net and v4.0 of .Net

On a particular event, I am setting its value from javascript.

Ext.getCmp('ddlCountryOfRisk_ddl').store.clearFilt er();
Ext.getCmp('ddlCountryOfRisk_ddl').setValue(cntry) ;
Ext.getCmp('ddlCountryOfRisk_ddl').readOnly = true;

Now if I am trying to change the selected value from the code behind on a postback event, this changed value is not showing back on the UI.

ddlCountryOfRisk.ReadOnly = false;
ddlCountryOfRisk.SelectedValue = value;

The same issue occurs if I change the value from UI and then try to set it from code behind on post back event.

Please assist me.

Nov 03, 2014, 3:05 PM
Hi @Maitreya,

Please provide a full test case to reproduce the issue.

Nov 04, 2014, 4:10 AM
I have a form which contains a combobox and a gridpanel into it.

RowEditing direct event of the GridPanel, I am calling a method which sets the selected value for the combobox.

<ext:RowEditing ID="reOwner" runat="server" ClicksToEdit="2" CommitChangesText="You need to cancel or commit your changes" SaveHandler="ValidateAddParent">
<BeforeEdit Fn="EnableOwnershipEditors" />
<CancelEdit Fn="EditOwnershipCancelled" />
<Edit OnEvent="RecordEdited" Before="insertOwner = false;" After="EnableAddButton(#{reOwner});SetUltimateParent();">
<ext:Parameter Name="Values" Value="Ext.encode(GetModifiedValues(#{pnlOwnership}))"
Mode="Raw" />
<EventMask ShowMask="true" CustomTarget="#{pnlOwnership}" />

Code Behind:

protected void RecordEdited(object sender, DirectEventArgs e)
var json = e.ExtraParams["Values"];


ddlCountryOfRisk.SelectedItem.Value = value


This selected value set on the direct event is not reflected on the UI.

Nov 04, 2014, 9:26 AM

If you need to change selected value in combo during direct event then use the following code

this.ComboBox2.SelectedItems.Add(new Ext.Net.ListItem { Value = "0" });

It is demonstrated in the following online example