<%@ Control Language="C#" AutoEventWireup="true" CodeFile="TopFiveArticlesSelector.ascx.cs" Inherits="CMSFormControls_TopFiveArticlesSelector" %><%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> <script type="text/javascript"> var hiddenfld = ("<%= this.Hidden.ClientID %>"); var cancelDropDownClosing = false; function StopPropagation(e) { //cancel bubbling e.cancelBubble = true; if (e.stopPropagation) { e.stopPropagation(); } } function onDropDownClosing() { cancelDropDownClosing = false; } function onCheckBoxClick(chk) { var combo = $find("<%= RadComboBox2.ClientID %>"); //holds the text of all checked items var text = ""; //holds the values of all checked items var values = ""; //get the collection of all items var items = combo.get_items(); //enumerate all items for (var i = 0; i < items.get_count(); i++) { var item = items.getItem(i); //get the checkbox element of the current item var chk1 = $get(combo.get_id() + "_i" + i + "_chk1"); if (chk1.checked) { text += item.get_text() + ","; values += item.get_value() + ","; //alert(item.get_value()); } } //remove the last comma from the string text = removeLastComma(text); values = removeLastComma(values); if (text.length > 0) { //set the text of the combobox combo.set_text(text); document.getElementById(hiddenfld).value = values; } else { //all checkboxes are unchecked //so reset the controls combo.set_text(""); } } //this method removes the ending comma from a string function removeLastComma(str) { return str.replace(/,$/,""); }</script><asp:HiddenField ID="Hidden" runat="server"/> <telerik:RadComboBox ID="RadComboBox2" runat="server" Width="400" AllowCustomText="true" DataValueField="DocumentID" DataTextField="Title" EmptyMessage="Select upto 5 articles" OnClientDropDownClosed="onDropDownClosing" > <ItemTemplate> <div onclick="StopPropagation(event)" class="combo-item-template"> <asp:CheckBox runat="server" ID="chk1" Text='<%#Eval("Title")%>' onclick="onCheckBoxClick(this)" /> </div> </ItemTemplate></telerik:RadComboBox>using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Data;using System.Web.UI;using System.Web.UI.WebControls;using System.Text;using CMS.SiteProvider;using CMS.CMSHelper;using CMS.GlobalHelper;using Telerik.Web.UI;public partial class CMSFormControls_TopFiveArticlesSelector : CMS.FormControls.FormEngineUserControl{ private DataTable dt = null; protected void Page_Load(object sender, EventArgs e) { ArticleItems(); } /// <summary> /// Gets or sets field value /// </summary> public override Object Value { get { return Hidden.Value.ToString(); } set { // Ensure drop down list options ArticleItems(); Hidden.Value = System.Convert.ToString(value); string[] RelatedID = Hidden.Value.Split(new char[] { ',' }); for (int i = 0; i < dt.Rows.Count; i++) { for (int e = 0; e < RelatedID.Length; e++) { if (dt.Rows[i]["DocumentId"].ToString() == RelatedID[e].ToString()) { RadComboBox2.Text += dt.Rows[i]["Title"].ToString() + ","; CheckBox checkbox = (CheckBox)RadComboBox2.Items[i].FindControl("chk1"); checkbox.Checked = true; } } } } } /// <summary> /// Returns true if some color is selected. If no, it returns false and displays an error message. /// </summary> public override bool IsValid() { if (RadComboBox2.Text != "") { return true; } else { // Set form control validation error message this.ValidationError = "Please Select Tags For This Article"; return false; } } protected void ArticleItems() { DataSet ds = TreeHelper.SelectNodes("/%", false, "CriticalCare.Conclusion;CriticalCare.Literature;CriticalCare.Theory", "", " ", -1, false); dt = new DataTable(); if (!DataHelper.DataSourceIsEmpty(ds)) { for (int i = 0; i < ds.Tables.Count; i++) { dt.Merge(ds.Tables[i]); } RadComboBox2.DataSource = dt; RadComboBox2.DataBind(); for (int i = 0; i < dt.Rows.Count; i++) { CheckBox checkbox = (CheckBox)RadComboBox2.Items[i].FindControl("chk1"); checkbox.ToolTip = dt.Rows[i]["DocumentID"].ToString(); } } }}<asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <telerik:RadComboBox ID="RadComboBox1" runat="server" HighlightTemplatedItems="true" > <Items> <telerik:RadComboBoxItem runat="server" Text="Jan" Value="1" /> <telerik:RadComboBoxItem runat="server" Text="feb" Value="2" /> <telerik:RadComboBoxItem runat="server" Text="Mar" Value="3" /> <telerik:RadComboBoxItem runat="server" Text="Apr" Value="4" /> <telerik:RadComboBoxItem runat="server" Text="May" Value="5" /> <telerik:RadComboBoxItem runat="server" Text="June" Value="6" /> <telerik:RadComboBoxItem runat="server" Text="July" Value="7" /> <telerik:RadComboBoxItem runat="server" Text="Aug" Value="8" /> <telerik:RadComboBoxItem runat="server" Text="Sep" Value="9" /> <telerik:RadComboBoxItem runat="server" Text="Oct" Value="10" /> <telerik:RadComboBoxItem runat="server" Text="Nov" Value="11" /> <telerik:RadComboBoxItem runat="server" Text="Dec" Value="12" /> </Items> </telerik:RadComboBox> <input id="Button1" type="button" value="button" onclick="getvalue();" /> <script type="text/javascript" language="javascript"> function getvalue() { var combo = <%=RadComboBox1.ClientID %>; var val= combo.GetValue(); // getting the selected value var text= combo.GetText(); // getting the selected text }<div id="header" class="Header_<%= ??? %>">Hello!
I am using a trial version of their software and I'm working with the component RadScheduler and I have the following problem.
When I add an appointment, I need to "start time" and "end time" appear in 24 hour format. Is this possible?
Dim txtActTickID As Telerik.Web.UI.RadTextBox = DirectCast(e.Container.FindControl("AttrAction Ticket"), Telerik.Web.UI.RadTextBox) txtActTickID.ReadOnly = True txtActTickID.BackColor = Drawing.Color.LightGray txtActTickID.ShowButton = True txtActTickID.ClientEvents.OnButtonClick = "ShowAT(" & txtActTickID.Text & ")" Dim objHL As New HyperLink objHL.NavigateUrl = "TestForm.aspx" objHL.Text = "Show Test Form" e.Container.Controls.Add(objHL)
<td runat="server" style="padding-bottom:15px; width:40px;">
<asp:Panel ID="pnlHolder" runat="server" Visible="true" ></asp:Panel>
<telerik:RadAjaxLoadingPanel id="LoadingPanel1" runat="server" Width="30px"
Height="30px" IsSticky="false" >
<asp:Image id="Image2" runat="server" ImageUrl="~/Image/ajax-loader.gif" />
</telerik:RadAjaxLoadingPanel>
</td>
<
script type="text/javascript" language="javascript">
var currentLoadingPanel = null;
var currentUpdatedControl = null;
function AjaxRequestStart() {
if (document.getElementById("<%= hdnAvailabilityChecker.ClientID %>").value == 1) {
return;
}
if (document.getElementById("<%= TextBox7.ClientID %>").value == "") {
return;
}
document.getElementById(
"<%= TextBox7.ClientID %>").value = document.getElementById("<%= TextBox7.ClientID %>").value.toUpperCase();
currentLoadingPanel = $find(
"<%= LoadingPanel1.ClientID %>");
currentUpdatedControl =
"<%=pnlHolder.ClientID %>";
currentLoadingPanel.show(currentUpdatedControl);
var t = setTimeout("AjaxResponseEnd()", 2000);
}
function AjaxResponseEnd() {
if (currentLoadingPanel != null) {
currentLoadingPanel.hide(currentUpdatedControl);
document.getElementById(
"<%= hdnAvailabilityChecker.ClientID %>").value = 1;
}
}
<telerik:GridCheckBoxColumn DataField="SiHy" HeaderText="SiHy" SortExpression="SiHy" UniqueName="SiHy" AllowFiltering="false"/>