View Full Version : [CLOSED] Selectbox setvalue on Page_Load problem 2.1

Apr 03, 2013, 9:43 AM
Hi from istanbul..

I have new problems with using 2.1 .. I have a select box that under code. and a store. I'm setting store datasource on Page_Load. and I try to set selectbox value with. "cmbRoomId.Setvalue(3);" function. but it is not working . if I use this code on a button click event it is working. but on Page_load not working..

<ext:SelectBox runat="server" ID="cmbRoomID" Width ="150px" StoreID="storeRooms" DisplayField="RoomName" ValueField="RoomID" > </ext:SelectBox>

<ext:Store ID="storeRooms" runat="server">
<ext:Model runat= "server">
<ext:ModelField Name= "RoomID"></ext:ModelField>
<ext:ModelField Name= "RoomName"></ext:ModelField>




also try to set panel title not working on Page_Load event.

pnlTitle.Title = "YENI TOPLANTI KAYDI";


Apr 03, 2013, 10:19 AM
Hi @antenonline,

To set up an initial value, please populate a SelectBox's SelectedItems collection.

Apr 03, 2013, 12:24 PM
thanks solved the problem with your help.

cmbRoomID.SelectedItems.Add(new Ext.Net.ListItem(lblRoomName.Text, iRoomID));

but need 2 parameter. if only need one parameter(ID). it would be better...

Apr 03, 2013, 2:54 PM
The following should work.

new Ext.Net.ListItem((object)"value");

new Ext.Net.ListItem() { Value = "value" };