| SELECT year(scheduledIn) [theYear] |
| , month(scheduledIn)[theMonth] |
| , scheduledIn |
| ,workOrderId |
| FROM [Work Orders] |
| WHERE aircraftID = 122 |
| AND archived = 0 |
| AND completed = 1 |
| ORDER BY year(scheduledIn) DESC, month(scheduledIn) DESC |
Hi,
In the following code, the dropdown control does not render in IE 7 or IE 8 compatibility mode. Removing the form decorator control causes the dropdown to render.
I'm running .NET 2.0 and RAD Controls 2009.1.527.20.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FormDecoratorTest.aspx.cs" Inherits="FormDecoratorTest" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Test</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<telerik:RadScriptManager ID="RSM1" runat="server" />
<telerik:RadFormDecorator ID="FD1" runat="server" DecoratedControls="None" />
<telerik:RadSplitter ID="RSB1" runat="server">
<telerik:RadPane ID="RP1" runat="server">
<asp:DropDownList ID="TestDDL" runat="server">
<asp:ListItem Text="Select One..." />
</asp:DropDownList>
</telerik:RadPane>
</telerik:RadSplitter>
</div>
</form>
</body>
</html>
| <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="TelerikTests2.WebForm1" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <!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"> |
| <title></title> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> |
| </telerik:RadScriptManager> |
| <div> |
| <telerik:RadMenu ID="RadMenu1" runat="server"> |
| </telerik:RadMenu> |
| </div> |
| </form> |
| </body> |
| </html> |
| <form id="Form1" method="post" runat="server"> |
| <asp:ScriptManager ID="ScriptManager1" runat="server"> |
| </asp:ScriptManager> |
| <telerik:RadAjaxManager ID="AjaxManager1" runat="server" EnableAJAX=true> |
| </telerik:RadAjaxManager> |
| <telerik:RadWindowManager Behavior=None ReloadOnShow=true Modal=true InitialBehavior=None VisibleStatusbar=false VisibleTitlebar=false id="Singleton" Skin="Default" runat="server"> |
| </telerik:RadWindowManager> |
| <div> |
| <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> |
| </asp:ContentPlaceHolder> |
| </div> |
| </form> |
| <asp:PlaceHolder ID="ContenuPage" Runat="server"></asp:PlaceHolder> |
| If Not IsNothing(SessionsProfil.getModule_Pret()) Then |
| AjaxManagerProxyRetards.AjaxSettings.AddAjaxSetting(GrilleRetards, SessionsProfil.getModule_Pret()) |
| End If |
| If Not IsNothing(SessionsProfil.getModule_Pret()) Then |
| SessionsProfil.getModule_Pret().Refresh() |
| End If |
| RadWindow newwindow = new RadWindow(); |
| newwindow.ID = "RadWindow2"; |
| newwindow.NavigateUrl = url; |
| newwindow.VisibleOnPageLoad = true; |
| newwindow.ReloadOnShow = true; |
| newwindow.OffsetElementID = button.ClientID; |
| newwindow.Left = new Unit(100); |
| newwindow.Top = new Unit(100); |
| newwindow.Width = width; |
| newwindow.Height = height; |
| newwindow.Modal = true; |
| newwindow.Behaviors = WindowBehaviors.Default; |
| newwindow.KeepInScreenBounds = true; |
| RadWindowManager1.Windows.Add(newwindow); |

| public class ComboCheckBoxTemplate : ITemplate |
| { |
| public void InstantiateIn( Control container ) |
| { |
| CheckBox cb = new CheckBox(); |
| cb.ID = "ComboCheckBox"; |
| cb.DataBinding += new EventHandler( CheckBox_DataBinding ); |
| container.Controls.Add( cb ); |
| } |
| void CheckBox_DataBinding( object sender, EventArgs e ) |
| { |
| CheckBox target = (CheckBox) sender; |
| RadComboBoxItem item = (RadComboBoxItem) target.BindingContainer; |
| target.Text = (string) DataBinder.Eval( item, "Text" ); |
| } |
| } |
| public partial class Default : System.Web.UI.Page |
| { |
| RadComboBox Combo1 |
| { |
| get { return this.RadComboBox1; } |
| } |
| protected override void OnInit( EventArgs e ) |
| { |
| RadComboBox1.ItemTemplate = new ComboCheckBoxTemplate(); |
| base.OnInit( e ); |
| } |
| protected void Page_Load( object sender, EventArgs e ) |
| { |
| if ( !this.IsPostBack ) |
| BindData(); |
| Combo1.DataBind(); |
| string str = GetCheckBoxValues( Combo1 ); // always an emtpy string here! |
| Combo1.Text = str; // This has no effect - the combo text is always set to "Item 1" |
| } |
| protected void BindData() |
| { |
| Combo1.Items.Clear(); |
| for ( int i = 1; i < 6; i++ ) |
| Combo1.Items.Add( new RadComboBoxItem( "Item " + Convert.ToString( i ), Convert.ToString( i ) ) ); |
| } |
| protected void RadComboBox_ItemDataBound( object sender, RadComboBoxItemEventArgs e ) |
| { |
| //Add each combo checkbox to the Handler |
| ( (CheckBox) e.Item.FindControl( "ComboCheckBox" ) ).Attributes.Add( "onclick", "checkboxClick('" + ( (Telerik.Web.UI.RadComboBox) sender ).ClientID + "', 'combo1Value');" ); |
| } |
| private string GetCheckBoxValues( Telerik.Web.UI.RadComboBox comboCheckbox ) |
| { |
| StringBuilder sbValues = new StringBuilder(); |
| foreach ( Telerik.Web.UI.RadComboBoxItem rcbItem in comboCheckbox.Items ) |
| { |
| //If the box is checked return a value |
| CheckBox cb = (CheckBox) rcbItem.FindControl( "ComboCheckBox" ); |
| if ( null != cb && cb.Checked ) |
| { |
| sbValues.Append( rcbItem.Value ); |
| sbValues.Append( "," ); |
| } |
| } |
| //Remove Trailing comma |
| string str = sbValues.ToString(); |
| if ( str.EndsWith( "," ) ) |
| return str.Remove( sbValues.Length - 1, 1 ); |
| return str; |
| } |
| private void SetCheckBoxValues( Telerik.Web.UI.RadComboBox comboCheckbox, string csv ) |
| { |
| string[] values = csv.Split( ',' ); |
| for ( int i = 0; i <= values.Length - 1; i++ ) |
| { |
| CheckBox chkbox = (CheckBox) comboCheckbox.FindItemByValue( values[ i ] ).FindControl( "ComboCheckBox" ); |
| if ( comboCheckbox.Text == "" ) |
| comboCheckbox.Text = string.Format( "{0}", chkbox.Text ); |
| else |
| comboCheckbox.Text = string.Format( "{0}, {1}", comboCheckbox.Text, chkbox.Text ); |
| chkbox.Checked = true; |
| } |
| } |
| protected void Button1_Click( object sender, EventArgs e ) |
| { |
| // if ( !( RadComboBox1.Text == "" ) ) |
| { |
| string str = GetCheckBoxValues( Combo1 ); |
| Label1.Text = str; |
| } |
| } |
| protected void Button2_Click( object sender, System.EventArgs e ) |
| { |
| BindData(); |
| SetCheckBoxValues( Combo1, TextBox1.Text ); |
| } |
| } |
| <form id="form1" runat="server"> |
| <script type="text/javascript"> |
| var supressDropDownClosing = false; |
| function OnClientDropDownClosing(sender, eventArgs) |
| { |
| eventArgs.set_cancel(supressDropDownClosing); |
| } |
| function OnClientSelectedIndexChanging(sender, eventArgs) |
| { |
| eventArgs.set_cancel(supressDropDownClosing); |
| } |
| function OnClientDropDownOpening(sender, eventArgs) |
| { |
| supressDropDownClosing = true; |
| } |
| function OnClientBlur(sender) |
| { |
| supressDropDownClosing = false; |
| sender.toggleDropDown(); |
| } |
| function checkboxClick(comboid,valueid) |
| { |
| collectSelectedItems( comboid, valueid ); |
| } |
| function getItemCheckBox(item) |
| { |
| //Get the 'div' representing the current RadComboBox Item. |
| var itemitemDiv = item.get_element(); |
| //Get the collection of all 'input' elements in the 'div' (which are contained in the Item). |
| var inputs = itemDiv.getElementsByTagName("input"); |
| for (var inputIndex = 0; inputIndex < inputs.length; inputIndex++) |
| { |
| var input = inputs[inputIndex]; |
| //Check the type of the current 'input' element. |
| if (input.type == "checkbox") |
| { |
| return input; |
| } |
| } |
| return null; |
| } |
| function collectSelectedItems( comboid, valueid ) |
| { |
| var combo = $find(comboid); |
| var items = combo.get_items(); |
| var selectedItemsTexts = ""; |
| var selectedItemsValues = ""; |
| var itemsitemsCount = items.get_count(); |
| for (var itemIndex = 0; itemIndex < itemsCount; itemIndex++) |
| { |
| var item = items.getItem(itemIndex); |
| var checkbox = getItemCheckBox(item); |
| //Check whether the Item's CheckBox) is checked. |
| if (checkbox.checked) |
| { |
| selectedItemsTexts += item.get_text() + ", "; |
| selectedItemsValues += item.get_value() + ", "; |
| } |
| } |
| selectedItemsTextsselectedItemsTexts = selectedItemsTexts.substring(0, selectedItemsTexts.length - 2); |
| selectedItemsValuesselectedItemsValues = selectedItemsValues.substring(0, selectedItemsValues.length - 2); |
| //Set the text of the RadComboBox with the texts of the selected Items, separated by ','. |
| combo.set_text(selectedItemsTexts); |
| //Set the comboValue hidden field value with values of the selected Items, separated by ','. |
| document.getElementById( valueid ).value = selectedItemsValues; |
| if (selectedItemsValues == "") |
| { |
| combo.clearSelection(); |
| } |
| } |
| </script> |
| <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager> |
| <input type="hidden" id="combo1Value" value="" runat="server" /> |
| <div> |
| <table style="width: 45%"> |
| <tr> |
| <td> |
| <telerik:RadComboBox ID="RadComboBox1" runat="server" onitemdatabound="RadComboBox_ItemDataBound"> |
| </telerik:RadComboBox> |
| </td> |
| <td> |
| <asp:Button ID="Button1" runat="server" Text="GetValues" onclick="Button1_Click" /> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| Results |
| </td> |
| <td> |
| <asp:Label ID="Label1" runat="server"></asp:Label> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <asp:TextBox ID="TextBox1" runat="server">1,3,5</asp:TextBox> |
| </td> |
| <td> |
| <asp:Button ID="Button2" runat="server" Text="SetValues" onclick="Button2_Click" /> |
| </td> |
| </tr> |
| </table> |
| </div> |
| </form> |