Feb 16, 2012, 10:15 PM
[CLOSED] MultiCombo Select All in Page_Load Using Store does not work
Hello,
I am trying to select all items in a multicombo on first page load. But it doesn't seem to work. What am I doing wrong? In the example below, both Multi1 and Multi2 should have all their items selected, but only Multi1 does.
I am trying to select all items in a multicombo on first page load. But it doesn't seem to work. What am I doing wrong? In the example below, both Multi1 and Multi2 should have all their items selected, but only Multi1 does.
<%@ Page Language="vb" AutoEventWireup="false" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<ext:ResourceManager runat="server" />
<title>Test Page</title>
<script runat="server" >
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Ext.Net.X.IsAjaxRequest Then
Multi1.SelectAll()
Me.Store1.DataSource = New Object() {New Object() {"Item 1", "1"}, New Object() {"Item 2", "2"}, New Object() {"Item 3", "3"}, New Object() {"Item 4", "4"}, New Object() {"Item 5", "5"}}
Me.Store1.DataBind()
Multi2.DataBind()
Multi2.SelectAll()
End If
End Sub
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<ext:Store ID="Store1" runat="server">
<Reader>
<ext:ArrayReader>
<Fields>
<ext:RecordField Name="field1" />
<ext:RecordField Name="field2" />
</Fields>
</ext:ArrayReader>
</Reader>
</ext:Store>
<ext:MultiCombo ID="Multi1" runat="server" Width="260">
<Items>
<ext:ListItem Text="Item 1" Value="1" />
<ext:ListItem Text="Item 2" Value="2" />
<ext:ListItem Text="Item 3" Value="3" />
<ext:ListItem Text="Item 4" Value="4" />
<ext:ListItem Text="Item 5" Value="5" />
</Items>
</ext:MultiCombo>
<ext:MultiCombo ID="Multi2" runat="server" Width="260" StoreID="Store1" DisplayField="field1" ValueField="field2" />
</div>
</form>
</body>
</html>
Last edited by Daniil; Feb 27, 2012 at 10:25 AM.
Reason: [CLOSED]