Oct 21, 2013, 2:19 PM
[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.
Thanks in Advance.
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]