Multi Select control for "select all Items" from client side & server Side is not working

  1. #1

    Multi Select control for "select all Items" from client side & server Side is not working

    I am converting Ext.Net 1.6 to 2.5.3 version.

    I also refer in the below post and Use code, but it is not working multiselect all items code in the 2.5.3 version.

    Code:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestMultiSelect.aspx.cs" Inherits="Jobs.TestMultiSelect" %>
    
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
     
    <script runat="server">
        protected void SelectAll(object sender, DirectEventArgs e)
        {
            for (int i = 0; i < MultiSelect1.Items.Count; i++) {
              MultiSelect1.SelectedItems.Add(new SelectedListItem(MultiSelect1.Items[i].Value));  
            }
      
            MultiSelect1.UpdateSelectedItems();
            
        }
        
        
    </script>
     
    <!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 id="Head1" runat="server">
        <title>Ext.Net Example</title>
    </head>
    <body>
        <form id="Form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
    
    
        <ext:MultiSelect ID="MultiSelect1" runat="server">
            <Items>
                <ext:ListItem Text="Item 1" Value="1" />
                <ext:ListItem Text="Item 2" Value="2" />
                <ext:ListItem Text="Item 3" Value="3" />
            </Items>
       <ListConfig ID="ListConfig1" runat="server">
           <Listeners>
                                                               
             <ItemClick Handler="if (App.MultiSelect1.getValue().indexOf('1')) { 
             alert(App.MultiSelect1.getValue().indexOf('1'));
             #{lblAuthorisedTrainingOrg}.show();
             } else {
             alert('error values -1');
             #{lblAuthorisedTrainingOrg}.hide();
             };" />
             </Listeners>
             </ListConfig>
        </ext:MultiSelect>
        <ext:Button ID="Button1" runat="server" Text="Select all Server Side">
            <DirectEvents>
                <Click OnEvent="SelectAll" />
            </DirectEvents>
        </ext:Button>
            <ext:Button ID="btnSelectAll" runat="server" StandOut="True" Text="Select All Client Side">
                                                                                                                     
           <Listeners>
           <Click Handler="#{MultiSelect1}.selectAll();
            " />
            </Listeners>
            </ext:Button>
            <ext:Button ID="btnClearAll" runat="server" StandOut="True" Text="Clear All">
            <Listeners>
            <Click Handler="#{MultiSelect1}.clear();
            #{lblAuthorisedTrainingOrg}.hide(); " />
            </Listeners>
           </ext:Button>
            <ext:Label ID="lblAuthorisedTrainingOrg" runat="server" Text="Test" Hidden="true"></ext:Label>
          </form>
    </body>
    </html>
    Error server Side:

    Click image for larger version. 

Name:	error inner html.jpg 
Views:	3 
Size:	85.1 KB 
ID:	24217

    Error Client Side:

    Click image for larger version. 

Name:	client side error.JPG 
Views:	4 
Size:	38.7 KB 
ID:	24218

    My Requirement:

    If i select all items then the inner Html error is throwing. How can i select all items from Multi select

    control throught client side and server side in the Ext.Net 2.5.3 version.


    how can i achieve the above task and please help us on this issue.
  2. #2
    Hi @yenkarthi,

    Server side exception is being discussed here:
    http://forums.ext.net/showthread.php?60029

    As for selecting all the items on client side, please use:
    App.MultiSelect1.boundList.getSelectionModel().selectAll();
  3. #3
    thanks daniil for your valuable guidance, It is working for me

Similar Threads

  1. Replies: 4
    Last Post: Sep 14, 2015, 6:06 AM
  2. Replies: 9
    Last Post: Aug 30, 2012, 2:51 PM
  3. Replies: 2
    Last Post: Feb 02, 2012, 3:15 PM
  4. [CLOSED] MultiSelect "select all" from client side
    By jmcantrell in forum 1.x Premium Help
    Replies: 12
    Last Post: Sep 20, 2011, 12:04 PM
  5. multi select add selected item on server side
    By [WP]joju in forum 1.x Help
    Replies: 4
    Last Post: Jan 09, 2009, 7:01 AM

Tags for this Thread

Posting Permissions