[CLOSED] Checkboxgroup control issue in IE9

  1. #1

    [CLOSED] Checkboxgroup control issue in IE9

    Hi Team,

    We have two checkboxgroup controls, adding checkboxes dynamically to Checkboxgroup controls,then we are getting an issue in IE9 like "Error: Invalid target element for this operation.". But it is working in Chrome and Firefox.

    Here is the sample code to reproduce the issue.



          
    <%--aspx Page Code --%>
    
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GrpahicalPlannerDetailViewExample.aspx.cs" Inherits="Cresent.WorkSafeExt.GraphicalPlanner.GrpahicalPlannerDetailViewExample" %>
    
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ResourceManager ID="rmDetailsView" runat="server" />
            <ext:Viewport ID="vpDetailsView" runat="server" Layout="BorderLayout">
                <Items>
                    <ext:Panel ID="PanelDetailsView" runat="server" Region="Center" Title="Details" AutoScroll="true" Layout="HBoxLayout">
                        <Items>
                            <ext:Panel ID="PanelEquipmentFilter" runat="server" Height="180" Width="200" Title="Equipment Filter" AutoScroll="true">
                                <Items>
                                    <ext:CheckboxGroup ID="CheckBoxGroupEquipmentFilter" runat="server" ColumnsNumber="1">
                                        <Content>
                                        </Content>
                                    </ext:CheckboxGroup>
                                </Items>
                            </ext:Panel>
                            <ext:Panel ID="PanelLocationFilter" runat="server" Height="180" Width="200" Title="Locations Filter" AutoScroll="true">
                                <Items>
                                    <ext:CheckboxGroup ID="CheckBoxGroupLocationsFilter" runat="server" ColumnsNumber="1">
                                        <Content>
                                        </Content>
                                    </ext:CheckboxGroup>
                                </Items>
                            </ext:Panel>
                        </Items>
                    </ext:Panel>
                </Items>
            </ext:Viewport>
        </form>
    </body>
    </html>
    <%-- .CS code --%>
    
    
     public partial class GrpahicalPlannerDetailViewExample : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                CreateandBindCheckboxContorls();
            }
    
            private void CreateandBindCheckboxContorls()
            {
                List<Equipment> EquipmentsList = GetEquipments();
                List<Location> Locations = GetLocations();
                FormEquipments(EquipmentsList);
                FormLocations(Locations);
            }
            private void FormEquipments(List<Equipment> EquipmentsList)
            {
                List<Ext.Net.Checkbox> checkboxesEuipments = new List<Checkbox>();
    
    
                foreach (Equipment equipment in EquipmentsList)
                {
                    Ext.Net.Checkbox CheckBoxEquipment = new Checkbox();
                    CheckBoxEquipment.ID = "CheckBoxEquipment" + equipment.EquipmentID.ToString();
                    CheckBoxEquipment.BoxLabel = equipment.EquipmentDescription;
                    CheckBoxEquipment.InputValue = equipment.EquipmentID.ToString();
                    CheckBoxEquipment.Checked = true;
                    CheckBoxGroupEquipmentFilter.ContentControls.Add(CheckBoxEquipment);
                }
    
                Ext.Net.Checkbox CheckBoxEquipmentNotApplicable = new Checkbox();
                CheckBoxEquipmentNotApplicable.ID = "CheckBoxEquipmentNotApplicable";
                CheckBoxEquipmentNotApplicable.BoxLabel = "Equipment Not Applicable";
                CheckBoxEquipmentNotApplicable.InputValue = "-99";
                CheckBoxEquipmentNotApplicable.Checked = true;
                CheckBoxGroupEquipmentFilter.ContentControls.Add(CheckBoxEquipmentNotApplicable);
            }
            private void FormLocations(List<Location> Locations)
            {
                foreach (Location location in Locations)
                {
                    Ext.Net.Checkbox CheckBoxLocation = new Checkbox();
                    CheckBoxLocation.ID = "CheckBoxLocation" + location.LocationID.ToString();
                    CheckBoxLocation.BoxLabel = location.LocationName;
                    CheckBoxLocation.InputValue = location.LocationID.ToString();
                    CheckBoxLocation.Checked = true;
                    CheckBoxGroupLocationsFilter.ContentControls.Add(CheckBoxLocation);
                }
            }
            private List<Equipment> GetEquipments()
            {
                List<Equipment> listEquipments = new List<Equipment>();
                listEquipments = new List<Equipment>()
                {
                   new Equipment(){EquipmentID=123,EquipmentDescription="3Equpement"},
                   
                   new Equipment(){EquipmentID=124,EquipmentDescription="4Equpement"},
                   
                   new Equipment(){EquipmentID=125,EquipmentDescription="5Equpement"},
                   
                   new Equipment(){EquipmentID=126,EquipmentDescription="6Equpement"},
    
                };
                return listEquipments;
            }
            private List<Location> GetLocations()
            {
                List<Location> listLocations = new List<Location>();
                listLocations = new List<Location>()
                {
                   new Location(){LocationID=127,LocationName="37Location"},
                   
                   new Location(){LocationID=128,LocationName="38Location"},
                   
                   new Location(){LocationID=129,LocationName="39Location"},
                   
                   new Location(){LocationID=130,LocationName="30Location"},
    
                };
    
                return listLocations;
            }
        }
    
    
        public class Equipment
        {
            public int EquipmentID
            {
                set;
                get;
            }
            public string EquipmentDescription
            {
                set;
                get;
            }
    
        }
        public class Location
        {
            public int LocationID
            {
                set;
                get;
            }
            public string LocationName
            {
                set;
                get;
            }
    
        }

    Thanks in Advance.
    Last edited by Daniil; Oct 22, 2013 at 10:07 AM. Reason: [CLOSED]
  2. #2
    You have to use Items instead ContentControls
  3. #3
    Hello!

    You should add Checkboxes into Items collection.

    ContentControls collection should be used with non Ext.NET controls like UserControls: http://forums.ext.net/showthread.php...ll=1#post56796

    private void FormEquipments(List<Equipment> EquipmentsList)
    {
        List<Ext.Net.Checkbox> checkboxesEuipments = new List<Checkbox>();
    
    
        foreach (Equipment equipment in EquipmentsList)
        {
            Ext.Net.Checkbox CheckBoxEquipment = new Checkbox();
            CheckBoxEquipment.ID = "CheckBoxEquipment" + equipment.EquipmentID.ToString();
            CheckBoxEquipment.BoxLabel = equipment.EquipmentDescription;
            CheckBoxEquipment.InputValue = equipment.EquipmentID.ToString();
            CheckBoxEquipment.Checked = true;
            CheckBoxGroupEquipmentFilter.Items.Add(CheckBoxEquipment);
        }
    
        Ext.Net.Checkbox CheckBoxEquipmentNotApplicable = new Checkbox();
        CheckBoxEquipmentNotApplicable.ID = "CheckBoxEquipmentNotApplicable";
        CheckBoxEquipmentNotApplicable.BoxLabel = "Equipment Not Applicable";
        CheckBoxEquipmentNotApplicable.InputValue = "-99";
        CheckBoxEquipmentNotApplicable.Checked = true;
        CheckBoxGroupEquipmentFilter.Items.Add(CheckBoxEquipmentNotApplicable);
    }
    private void FormLocations(List<Location> Locations)
    {
        foreach (Location location in Locations)
        {
            Ext.Net.Checkbox CheckBoxLocation = new Checkbox();
            CheckBoxLocation.ID = "CheckBoxLocation" + location.LocationID.ToString();
            CheckBoxLocation.BoxLabel = location.LocationName;
            CheckBoxLocation.InputValue = location.LocationID.ToString();
            CheckBoxLocation.Checked = true;
            CheckBoxGroupLocationsFilter.Items.Add(CheckBoxLocation);
        }
    }
  4. #4
    Thanks.Issue is solved.You can mark as close.

Similar Threads

  1. ext control back date issue
    By atulsetu in forum 2.x Help
    Replies: 1
    Last Post: Dec 06, 2012, 3:28 PM
  2. CheckboxGroup and RadioGroup display issue
    By zhaoxl in forum 1.x Help
    Replies: 9
    Last Post: Jan 04, 2012, 4:05 AM
  3. User control issue
    By maephisto in forum 1.x Help
    Replies: 2
    Last Post: Apr 19, 2011, 10:54 AM
  4. [CLOSED] Control Rendering issue
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 05, 2011, 5:26 PM
  5. [CLOSED] checkboxgroup issue
    By idrissb in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 13, 2009, 10:48 AM

Posting Permissions