View Full Version : [CLOSED] ComboBox resetting multiSelect value

May 16, 2014, 12:45 PM
I have a dialog that is reconfigured based on how I am using it. One control is a combobox that I need to switch from MultiSelect to SingleSelect and maybe back again.

I now have to code working but I had to ReRender the control after setting MultiSelect in the behind code. Does that sound correct?

Just wanted to make sure I am not doing something I am not suppose to do and have consequences down the line.

I typically do not use Render or Rerender anywhere in my code. But is there a basic rule that if you change config parameters after the control has been rendered you should rerender it.

May 16, 2014, 2:33 PM
Hi Chris,

Yes, it is a basic rule - if you need to change some settings, you might need to re-render a component, unless it is possible to change some setting on the fly. Many options are possible to change on the fly, some ones are not. If you don't know it is possible to change on the fly or not, re-rendering is a way to go or investigation how to change it on the fly:)

It appears to possible to change a selection mode on the fly.


<%@ Page Language="C#" %>

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
if (!X.IsAjaxRequest)
Store store = this.ComboBox1.GetStore();
store.DataSource = new object[]
new object[] { "1", "Item 1" },
new object[] { "2", "Item 2" },
new object[] { "3", "Item 3" }

<!DOCTYPE html>

<head runat="server">
<title>Ext.NET v2 Example</title>
<form runat="server">
<ext:ResourceManager runat="server" />

Text="Single select"
Handler="App.ComboBox1.multiSelect = false;
App.ComboBox1.getPicker().selModel.setSelectionMod e('SINGLE');

Text="Multi select"
Handler="App.ComboBox1.multiSelect = true;
App.ComboBox1.getPicker().selModel.setSelectionMod e('SIMPLE');"

<ext:Store runat="server">
<ext:Model runat="server">
<ext:ModelField Name="value" />
<ext:ModelField Name="text" />
<ext:ArrayReader />