Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
1.6K+ views
Hi

How to i Disable Previous dates,  Means less then today in Rad Date Picker.

I need to show to select current date and future dates only.

i want to disable Previous dates.

Please Reply for this soon..

Thanks,
Ashok Anbarasu.
mahen
Top achievements
Rank 1
 answered on 13 Apr 2017
0 answers
245 views

Hello Telerik Team,

Kindly, I got an error regarding the casting of a telerik object. I have removed the telerik compresion but my application is using a dinamic layer to create the control in the page, Also i will be removing the telerik compresion for all the clases in the control layer. Please can you provide more information regarding the below error, see the details:
Impossible d'effectuer un cast d'un objet de type 'Telerik.Web.UI.CompressedPageState' en type 'System.Collections.IDictionary'.
Informations sur l'erreur: Type: InvalidCastException Message: Impossible d'effectuer un cast d'un objet de type 'Telerik.Web.UI.CompressedPageState' en type 'System.Collections.IDictionary'. Trace de la pile: à System.Web.UI.Page.RegisterRequiresControlState(Control control) à Telerik.Web.UI.RadComboBox.OnInit(EventArgs e) à System.Web.UI.Control.InitRecursive(Control namingContainer) à System.Web.UI.Control.AddedControl(Control control, Int32 index) à System.Web.UI.ControlCollection.Add(Control child) à Telerik.Web.UI.GridPagerButtonBuilder.CreatePageSizeDropDown(Panel container) à Telerik.Web.UI.GridPagerButtonBuilder.CreatePageSize(Panel container) à Telerik.Web.UI.GridPagerItem.InitializePagerItem(GridColumn[] columns) à Telerik.Web.UI.GridPagerItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows) à Telerik.Web.UI.GridTableView.CreateTopPagerItem(Boolean useDataSource, GridColumn[] copiedColumnSet, Boolean isPagingEnabled, GridTHead thead) à Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) à Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) à System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) à System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) à System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) à System.Web.UI.WebControls.DataBoundControl.PerformSelect() à Telerik.Web.UI.GridTableView.PerformSelect() à System.Web.UI.WebControls.BaseDataBoundControl.DataBind() à Telerik.Web.UI.GridTableView.DataBind() à Telerik.Web.UI.RadGrid.DataBind() à Telerik.Web.UI.RadGrid.AutoDataBind(GridRebindReason rebindReason) à Telerik.Web.UI.RadGrid.OnLoad(EventArgs e) à Env.MYAPPLICATION.Web.Controles.FormulaireGrilleGenerique`1.OnLoad(EventArgs e) dans e:MYAPPLICATION\Env.MYAPPLICATION.Web.Controles\FormulaireGrilleGenerique.cs:ligne 90 à System.Web.UI.Control.LoadRecursive() à System.Web.UI.Control.LoadRecursive() à System.Web.UI.Control.LoadRecursive() à System.Web.UI.Control.LoadRecursive() à System.Web.UI.Control.LoadRecursive() à System.Web.UI.Control.LoadRecursive() à System.Web.UI.Control.LoadRecursive() à System.Web.UI.Control.LoadRecursive() à System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 
Line 90: MYAPPLICATION\Env.MYAPPLICATION.Web.Controles\FormulaireGrilleGenerique.cs:ligne 90:
protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);      

        }

Guillermo José
Top achievements
Rank 1
 asked on 12 Apr 2017
2 answers
1.1K+ views

Hello,

After I updated to 2015 q1 I get following error

Upgrade problem - Unable to cast object of type 'Telerik.Web.UI.ElasticButton' to type 'System.Web.UI.WebControls.LinkButton'

This happens in ItemCreated. I was using following code to hide insertitem when I used insertbutton to open a Radwindow.

 

protected void ClassesOverviewGrid_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridEditableItem && e.Item.IsInEditMode)
        {
            if (e.Item.OwnerTableView.IsItemInserted)
            {
                GridEditableItem item = e.Item as GridEditableItem;

                LinkButton updateButton = (LinkButton)item.FindControl("PerformInsertButton");

                ((GridTableRow)updateButton.Parent.Parent).Style.Value += "display:none";

            }
        }

}

 

If I change to 

LinkButton updateButton = (LinkButton)item.FindControl("PerformInsertButton");

((GridTableRow)updateButton.Parent.Parent).Style.Value += "display:none";

then I get the error in second line:

 

Additional information: Unable to cast object of type 'EditFormTableCell' to type 'Telerik.Web.UI.GridTableRow'.

 

Do you know how I can fix this?

Guillermo José
Top achievements
Rank 1
 answered on 12 Apr 2017
5 answers
234 views
Using 2014.3.1209.40 DLL getting JavaScript error if user tries to filter a column with a string containing an apostrophe (single quote, chr(39))

Same behavior can be seen in Telerik's own online demo: http://demos.telerik.com/aspnet-ajax/grid/examples/overview/defaultcs.aspx
In Model column enter something like Joe's click the filter button, select Contains and you get:

Line: 5022
Error: Expected ')'

Tried escaping the apostrophe as \' or /' or ['] - same result

As an unrelated issue - tried entering HTML encoded string version Joe's and clicked filter/Contains - page redirected to "Oh, no!  It seems we've lost this page!"

Pavlina
Telerik team
 answered on 12 Apr 2017
1 answer
101 views

Whenever I do resize for radeditor. It fails to render correctly.

Please see this attached screenshot.

 

Rahul
Top achievements
Rank 2
 answered on 12 Apr 2017
1 answer
233 views

Why, when I use Material as the base for a theme - do I only have 2 options?  Nothing under primitives - so I can't (for example) give RadMenu a background of other than white.

Am I doing something wrong?

Dimitar
Telerik team
 answered on 12 Apr 2017
6 answers
303 views
hi all ,
i have radgrid on page with nestedviewTemplate , in nested view template i call user control (.ascx)
page size is 10 for mastertable 
in user control i have one radgrid . when i load page it goes in load event of user control for 10 times (page size of master table) 
and load the entire grid on user control 10 times .
it takes too long time ,so for any postback (syn/asyn) pointer go in user controls load method .
i dont want this scenario ,instead i want when user clicks on expand button only that time it should call the usercontrol for only taht record and fetch same data for record only instead of binding all data every time 

how should i go further ...looking for helping hands :) thnx in advance 
Isaac
Top achievements
Rank 1
 answered on 12 Apr 2017
7 answers
289 views

 

Hi, I have a simple ASPX page with a RadComboBox.  I have noticed that the "ClientState" form data doesn't get added to the request when the form submits unless I have opened the combobox and made a selection.  Is there any way to get ClientState to populate without making the user select one of the list items--say a default option?

<!DOCTYPE html>
<head runat="server">
    <title>Test RadComboBox</title>
</head>
<body>
<form id="form1" action="TelerikTest.aspx" runat="server">
    <telerik:RadScriptManager runat="server">
        <Scripts>
            <asp:scriptreference assembly="Telerik.Web.UI" name="Telerik.Web.UI.Common.Core.js"></asp:scriptreference>
            <asp:scriptreference assembly="Telerik.Web.UI" name="Telerik.Web.UI.Common.jQuery.js"></asp:scriptreference>
            <asp:scriptreference assembly="Telerik.Web.UI" name="Telerik.Web.UI.Common.jQueryInclude.js"></asp:scriptreference>
        </Scripts>
    </telerik:RadScriptManager>
        <telerik:RadComboBox ID="RadComboBox1" runat="server">
            <Items>
                <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem1" Value="RadComboBoxItem1"/>
                <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem2" Value="RadComboBoxItem2"/>
            </Items>
        </telerik:RadComboBox>
        <input id="Button1" type="submit" value="submit" />
</form>
</body>
</html>
Marin Bratanov
Telerik team
 answered on 12 Apr 2017
0 answers
241 views

Dear Telerik Team,

 

We would like to use rad notification session timeout feature in my code but we have different project scenario.

We have master page in project but Form tag is inside content page so we are not able to add notification control in master page.

We don't want to add rad notification on each page.

We have created a dynamic control on page load but getting error on continue session button.

 

Master Page ASPX

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site1.master.cs" Inherits="SampleApplicationSession.Site1" %>

<!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>
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
     <div class="clockSession">
            <div class="contSession">
                <div class="sesseionExpire">
                    Your Session will expire in minutes</div>
                <div class="showNotification">
                    Notification will be shown in:</div>
                <div class="timeRemain">
                    <span class="timeSeconds"><span id="mainLbl">60 </span></span>seconds</div>
            </div>
        </div>
    <div>
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
        
        </asp:ContentPlaceHolder>
    </div>
</body>
</html>

 

Master page CS

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SampleApplicationSession
{
    public partial class Site1 : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}

WebForm1.CS

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SampleApplicationSession
{
    public partial class WebForm1 :BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["Userid"] = "Test";

        }
    }
}

 

WebForm ASPX

 

<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="SampleApplicationSession.WebForm1" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>




<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">


   

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
 
<form id="GlmasterViewForm" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    <Scripts>
        <asp:ScriptReference Assembly="Telerik.Web.UI" 
            Name="Telerik.Web.UI.Common.Core.js">
        </asp:ScriptReference>
        <asp:ScriptReference Assembly="Telerik.Web.UI" 
            Name="Telerik.Web.UI.Common.jQuery.js">
        </asp:ScriptReference>
        <asp:ScriptReference Assembly="Telerik.Web.UI" 
            Name="Telerik.Web.UI.Common.jQueryInclude.js">
        </asp:ScriptReference>
    </Scripts>
</telerik:RadScriptManager>
</form>

</asp:Content>

BaseFile

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Telerik.Web.UI;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;


namespace SampleApplicationSession
{
    public class BasePage : System.Web.UI.Page
    {

        RadNotification SessionTimeOutNotification = new RadNotification();

        protected void OnCallbackUpdate(object sender, RadNotificationEventArgs e)
        {

        }
        protected override void OnLoad(EventArgs e)
        {
            try
            {

                if (!Page.IsPostBack)
                {
      



                    SessionTimeOutNotification.ContentContainer.CssClass = "";
                    SessionTimeOutNotification.ID = "TestRad";
                    SessionTimeOutNotification.RenderMode = RenderMode.Lightweight;
                    //SessionTimeOutNotification.Position = NotificationPosition.TopCenter;
                    //rad.Width = 190;
                    SessionTimeOutNotification.Title = "Continue Your Session";
                    SessionTimeOutNotification.EnableRoundedCorners = true;
                    SessionTimeOutNotification.ShowCloseButton = false;
                    SessionTimeOutNotification.KeepOnMouseOver = false;
                    SessionTimeOutNotification.LoadContentOn = NotificationLoad.PageLoad;
                    //SessionTimeOutNotification.AutoCloseDelay = 6000;
                    
                   
                    //configure the notification to automatically show 1 min before session expiration
                    SessionTimeOutNotification.ShowInterval = (Session.Timeout - (Session.Timeout - 1)) * 60 * 1000;
                    SessionTimeOutNotification.AutoCloseDelay = 60000;

                    //set the redirect url as a value for an easier and faster extraction in on the client
                    SessionTimeOutNotification.Value = Page.ResolveClientUrl("SessionExpired.aspx");
                    MyTemplate1 objTemplate = new MyTemplate1();
                    SessionTimeOutNotification.ContentTemplate = objTemplate;
                    SessionTimeOutNotification.OnClientShowing = "notification_showing";
                    SessionTimeOutNotification.OnClientHidden = "notification_hidden";

                    SessionTimeOutNotification.CallbackUpdate += OnCallbackUpdate;

                    //SessionTimeOutNotification.CallbackUpdate += new EventHandler(OnCallbackUpdate);

                    this.Form.Controls.Add(SessionTimeOutNotification);

                    if (!ClientScript.IsStartupScriptRegistered("key1"))
                    {
                        ClientScript.RegisterStartupScript(GetType(), "key1", @"<script type=""text/javascript"" src=""../Resources/js/SessionExpired.js""></script>");
                    }

                    if (!ClientScript.IsStartupScriptRegistered("SessionControlScript"))
                    {
                        String cstext1 = "<script type=\"text/javascript\">" +
                        "serverIDs({ notificationID: 'ctl00_ContentPlaceHolder1_TestRad' });</" + "script>";
                        
                        ClientScript.RegisterStartupScript(GetType(), "SessionControlScript", cstext1);
                    }


                }
            }
            catch(Exception ex )
            {}


    
        }

        /// <summary>
        /// This is the base class for the web pages.
        /// We need to implement the common functionalities in this 
        /// class going forward.
        /// </summary>
        public class MyTemplate1 : ITemplate
        {
            protected RadButton btnMsg;
            string colnames;
            public MyTemplate1()
            {

            }
            public void InstantiateIn(System.Web.UI.Control container)
            {


                btnMsg = new RadButton();
                btnMsg.ID = "btnMsg";
                btnMsg.Text = "Continue Your Session";
                btnMsg.OnClientClicked = "ContinueSession";
                btnMsg.AutoPostBack = false;

                //boolValue.DataBinding += new EventHandler(boolValue_DataBinding);
                // boolValue.Enabled = false;
                HtmlGenericControl DivinfoIcon = new HtmlGenericControl("DIV");
                DivinfoIcon.Attributes.Add("class", "infoIcon");
                HtmlGenericControl DivinotificationContent = new HtmlGenericControl("DIV");
                DivinotificationContent.Attributes.Add("class", "notificationContent");
                HtmlGenericControl Div1 = new HtmlGenericControl("DIV");
                Label lblText = new Label();
                lblText.Text = "Time remaining: ";
                lblText.ID = "lblTime";
                HtmlGenericControl tiemlbl = new HtmlGenericControl("SPAN");
                tiemlbl.ID = "timeLbl";
                tiemlbl.InnerHtml = "60";
                tiemlbl.Attributes.Add("class", "timeLbl");
                Div1.Controls.AddAt(0, lblText);
                Div1.Controls.AddAt(1, tiemlbl);
                DivinotificationContent.Controls.AddAt(0, Div1);
                DivinotificationContent.Controls.AddAt(1, btnMsg);
                DivinfoIcon.Controls.Add(DivinotificationContent);
                container.Controls.Add(DivinfoIcon);
            }
        }

    }
}

 

 

i am getting attached error on this. Is there any better way to implement it ?

 

 

 

 

 

 

vivek
Top achievements
Rank 1
 asked on 12 Apr 2017
1 answer
213 views

Is there a way to specify a property from the combo box setup with check items to be passed to a control parameter property?

<asp:ControlParameter ControlID="cmbProviderSort" DbType="Int32" ConvertEmptyStringToNull="true" DefaultValue="-1" PropertyName="SelectedValue" Name="a" />

 

PropertyName is set as SelectedValue which will only work with a non checkbox combo box. What is the best approach to be able to send in all checked items into the asp:ControlParameter.

 

I have to use the DataSource setup in this way and cannot do it in the code behind. Thanks

Eyup
Telerik team
 answered on 12 Apr 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?