Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
199 views
Hi

Id like to replace a textbox in the insert form with a combo box that has values poulated from database. Any suggestions?

Thanks in advance
Princy
Top achievements
Rank 2
 answered on 08 Oct 2012
1 answer
724 views
I have a RadGrid with textbox filters which I have set to AutoPostBack = False. I've also hidden the FIlter Icon.

I have created a button in the command row for "Apply filters". I want to use the "Apply Filters" command button to evaluate the value of the column filter textboxes and then trigger the internal filtering event for the grid.

ie: user types into filter textboxes, then clicks "Apply Filters" which builds the FilterExpression and triggers the filtering event.

Could you help me out with an example, I have been searching but no luck.


Shinu
Top achievements
Rank 2
 answered on 08 Oct 2012
4 answers
163 views
Hi support team,
I get a script error after clicking on Generate New Image link more 3 times.
It means that the first and second time, the image is generated successfully.
But in the third time, there is a script error and image is not generated, refer to scripterror.jpg.
Error detail:
Message: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 404
Line: 6
Char: 62099
Code: 0
URI: http://
[My Server]/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_PlaceHolderMain_ctl00_ctl00_ctl00_RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a55ab6258-ebc5-40d7-ae7b-b95de6f72668%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2011.3.1115.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3ad841c84c-68bb-4f5c-b77b-50f39a462ac8%3a16e4e7cd%3ab7778d6c%3ae085fe68%3ac08e9f8a%3a1bb784d4%3a11e117d7

My configuration is here:
Browser: IE8
The captcha is integrated into MOSS 2007.
<telerik:RadCaptcha ID="RadCaptchaControl" runat="server" ErrorMessage="The code you entered is not valid."
                        ValidationGroup="captchagroup" ValidatedTextBoxID="txtRadCaptcha" Display="Dynamic"
                        EnableRefreshImage="true" CaptchaImage-EnableCaptchaAudio="true" CaptchaImage-UseAudioFiles="true" ImageStorageLocation="Session"
                        CaptchaImage-AudioFilesPath="_layouts/Audio/RadCaptcha">
                        <CaptchaImage EnableCaptchaAudio="true" RenderImageOnly="true" ImageCssClass="rcCaptchaImage" 
                            BackgroundColor="#609f0a" TextColor="Black" BackgroundNoise="None" ImageAlternativeText="captcha use audio" />
                    </telerik:RadCaptcha>
web.config:
<httpHandlers>
<add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResourceSession, Telerik.Web.UI, Version=2011.3.1115.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" verb="*" validate="false" />
</httpHandlers>
The reason I configured type="Telerik.Web.UI.WebResourceSession" b/c there are 2 servers (load balance).  

<handlers>
<add name="Telerik.Web.UI.WebResource" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" />
</handlers>
<location path="Telerik.Web.UI.WebResource.axd">
    <system.web>
        <authorization>
            <allow users="*"/>
        </authorization>
    </system.web>
</location>

I used UrlRewriter in my app, but I also apply this article: http://www.iis.net/learn/extensions/url-rewrite-module/url-rewriting-for-aspnet-web-forms 
 <rule name="do not rewrite axd files" stopProcessing="true">
          <match url="\.axd$" />
          <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
          </conditions>
          <action type="None" />
        </rule>
I appreciate if you can help me sort out the problem. Many Thanks.
Hung
Top achievements
Rank 1
 answered on 08 Oct 2012
1 answer
129 views
Hello,

I've created my own class inheriting from the RadScheduler in order to customize the view to display as an hebrew calendar - right to left with hebrew dates at the calendar header and at each cell header.

After working on overriding the CreateChildControls on the server side, finding the controls I need and changing them to fit my needs, I was able to put an empty scheduler control and see it rendering as I expected - everything worked great, I'll note I wasn't using ajax, and moving through months made a post-back and the calendar showed with all my hebrew strings and settings.

My next requirement was to call a webservice that can be called only from a client side code, so I've used jQuery and added the result using $find('<%=schScheduler.ClientID %>').insertAppointment(newAppointment); - the appointment wasn't added at first, but after looking at this: http://www.telerik.com/community/forums/aspnet-ajax/scheduler/insert-appointment-client-side.aspx#823397 I've changed the provider of the scheduler to a dummy webservice which returns empty lists and added a cancelEvent client handlers.
After doing this, every time I refresh the page I see my hebrew calendar for a second or less and then it renders to the english default radscheduler calendar with none of my hebrew settings or string, as if the entire dom elements are being re-created using javascript after receiving the empty list from the dummy webservice.

I can't seem to add the appointment using jQuery if the scheduler is not using webservice provider. On the other hand, I've worked a lot on customizing the scheduler on the server side, Is there's a way to disable that javascript rerendering of the control after a webservice response? I've tried disabling the OnClientRequestSuccess event with the cancelEvent (as described in the link above) but then nothing happens (I can't move through months)..

Help!!

This is some of my aspx code:
<hbc:HebrewCalendar runat="server" ID="schScheduler" TimeZoneOffset="03:00:00" SelectedView="MonthView"
                  DayStartTime="08:00:00" DayEndTime="22:00:00" EnableDescriptionField="true" Culture="Hebrew (Israel)"
                  OverflowBehavior="Expand" FirstDayOfWeek="Sunday" OnClientNavigationComplete="OnClientNavigationComplete"
                  OnClientAppointmentWebServiceInserting="OnClientAppointmentWebServiceInserting"
                  OnClientAppointmentsPopulating="OnClientAppointmentsPopulating"
                  OnClientResourcesPopulating="OnClientResourcesPopulating">
    <WebServiceSettings Path="~/AppointmentsWebService.asmx" />
</hbc:HebrewCalendar>
<script language="javascript" type="text/javascript">
var adding_appt = false;
var scheduler;
 
$('#<%=schScheduler.ClientID %>').ready(function () {
    loadAppointments($find('<%=schScheduler.ClientID %>'));
});
 
function loadAppointments(sceduler) {
    var startDate = sceduler.get_firstDayStart();
    var endDate = sceduler.get_activeModel().get_visibleRangeEnd();
    $.getJSON('<%= GetApptUrl %>', function (appointments) {
                   for (var i = 0; i < appointments.length; i++) {
                       var apt = appointments[i];
 
                       var newAppointment = new Telerik.Web.UI.SchedulerAppointment();
 
                       var start = $.datepicker.parseDate("dd/mm/yy", apt.StartDate);
                       start.setHours(apt.StartHour.split(':')[0]);
                       var end = $.datepicker.parseDate("dd/mm/yy", apt.EndDate);
                       end.setHours(apt.EndHour.split(':')[0]);
 
                       newAppointment.set_start(start);
                       newAppointment.set_end(end);
                       newAppointment.set_subject(apt.Subject);
 
                       adding_appt = true;
                       sceduler.insertAppointment(newAppointment);
                       adding_appt = false;
                   }
               });
}
function OnClientNavigationComplete(sender, eventArgs) {
    loadAppointments(sender);
}
function OnClientAppointmentsPopulating(sender, eventArgs) {
    if (adding_appt)
        eventArgs.set_cancel(true);
}
function OnClientAppointmentWebServiceInserting(sender, eventArgs) {
    if (adding_appt)
        eventArgs.set_cancel(true);
}
function OnClientResourcesPopulating(sender, eventArgs) {
    if (adding_appt)
        eventArgs.set_cancel(true);
}
</script>


I've attached some of my hebrew calendar code to demonstrate part of the things I'm doing on server side (it's about 20% of the logic, it's not really relevant to the problem I'm having on the client side so I truncated most of it to avoid confusion):

public class HebrewCalendar : RadScheduler
{
    protected override void CreateChildControls()
    {
        base.CreateChildControls();
 
        var allControls = AllControls().ToList();
        var allHtmlGenericControls = allControls.OfType<HtmlGenericControl>();
        var minDate = DateTime.MaxValue;
        var maxDate = DateTime.MinValue;
        MakeViewJewish(allHtmlGenericControls, ref minDate, ref maxDate);
 
        // Update top only if dates exists or in case this is a single day view
        if ((minDate != DateTime.MaxValue && maxDate != DateTime.MinValue) || SelectedView == SchedulerViewType.DayView)
        {
            var header = allControls.OfType<LiteralControl>().Where(lt => lt.ID == "DateLabel").FirstOrDefault();
 
            if (header != null)
            {
                switch (SelectedView)
                {
                    case SchedulerViewType.MonthView:
                        header.Text = string.Format("<div class='header-date-text'>{0} ({1})</div>", header.Text, GetHebrewMonths(minDate, maxDate));
                        break;
                }
            }
        }
 
        // Swap prev/next buttons on the upper-left corner of the calendar
        var prev = allControls.OfType<HtmlGenericControl>().Where(c => c.Attributes["class"] == "rsPrevDay").FirstOrDefault();
        var next = allControls.OfType<HtmlGenericControl>().Where(c => c.Attributes["class"] == "rsNextDay").FirstOrDefault();
        if (prev != null && next != null)
        {
            prev.Attributes["class"] = "rsNextDay";
            next.Attributes["class"] = "rsPrevDay";
 
            var prevHtml = prev.InnerHtml;
            prev.InnerHtml = next.InnerHtml;
            next.InnerHtml = prevHtml;
        }
    }
 
    private void MakeViewJewish(IEnumerable<HtmlGenericControl> allHtmlGenericControls, ref DateTime minDate, ref DateTime maxDate)
    {
        foreach (var control in allDateControls)
        {
            try
            {
                string hebDay, hebMonth;
                DateTime controlDate = DateTime.MinValue;
                switch (SelectedView)
                {
                    case SchedulerViewType.MonthView:
                        // Check if this cell wasn't handled already
                        if (control.Attributes["title"].EndsWith(")"))
                            continue;
 
                        // Add hebrew day string
                        controlDate = DateTime.Parse(control.Attributes["title"], Culture);
                        hebDay = GetHebrewDay(controlDate);
                        hebMonth = GetHebrewMonth(controlDate);
                        control.Attributes["title"] += string.Format(" ({0} ב{1})", hebDay, hebMonth);
                        control.InnerHtml = string.Format("<div class='eng-date'>{0}</div><div class='heb-date'>{1}</div>",
                                                          control.InnerHtml,
                                                          hebDay != "א'" ? hebDay : string.Format("{0} {1}", hebDay, hebMonth));
                        break;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
 
    #region Georgian to hebrew date converting
            // Code irelevant to the problem...
    #endregion
}
Adam
Top achievements
Rank 1
 answered on 07 Oct 2012
4 answers
110 views
Hi

View code:
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="TestForm1.aspx.vb" Inherits="MMPA.Expenses.TestForm1" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
      
    <telerik:RadNumericTextBox ID="npermilesTextBox" runat="server" Value='0'
        Width="90px" MaxValue="999" MinValue="0" Type="Number"
        NumberFormat-DecimalDigits="0" AllowOutOfRangeAutoCorrect="false"
        EnabledStyle-HorizontalAlign="Right" DataType="System.Int32" Enabled="false">
    </telerik:RadNumericTextBox>
</asp:Content>
Code behind:
Imports Telerik.Web.UI
Public Class TestForm1
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        npermilesTextBox.Text = "0"
    End Sub
End Class
Problem must have code behind and enable set to false.  See image:

Phil
P.S. The problem seems to be in IE rendering.  No problem in FF.
Phil
Top achievements
Rank 2
 answered on 06 Oct 2012
2 answers
92 views
Good afternoon from a project created with Delphi ASP. At the time of executing the Page_Load function I can show through VisibleOnPageLoad Radwindow, however when you click on another event, such as a button or the progreama Selected_IndexChanged shows no Radwindow I want. I think this may be present because several radwindow management, since according to the type of product you need to load a specific form: but not what the problem is, I appreciate any cooperation
Miguel Angel
Top achievements
Rank 1
 answered on 06 Oct 2012
2 answers
210 views

The example given in the RadControls documentation (getting started) is working fine in regular aspx pages, but I can’t get it to work from the Master/Content page. It could make it work in the Content Page  after setting the property of “VisibleOnPageLoad”  to TRUE, however it will display  RadWindow automatically, when the page is loaded.
My problem is that I don’t want to display the RadWindow initially when the page is loaded.  I need to display RadWindow only after a control (ex.Button) is clicked.
TheRadScriptManager is on MasterPage, the RadWindowManager is on Content Page.

 

How can I open RadWindow using a control (ex. Button) from a content page?
Thank You,
Thomas

This is my  code from content page:

<%@ Page Title="" Language="C#" MasterPageFile="~/DefaultMaster.Master" AutoEventWireup="true" CodeBehind="Default1.aspx.cs" Inherits="TestRadWindow.Default" %> 
<%@ 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">      
 <telerik:RadWindowManager ID="RadWindowManager1" runat="server"   
        ReloadOnShow="True">  
            <Windows> 
                <telerik:RadWindow ID="rdWnd" runat="server" Behavior="Default"   
                    InitialBehavior="None" Left="" NavigateUrl="Sample1.aspx"   
                    OpenerElementID="LinkButton1" Top="" ReloadOnShow="True" Visible="True"   
                    EnableViewState="True" > 
                </telerik:RadWindow> 
            </Windows> 
        </telerik:RadWindowManager> 
          
    <asp:LinkButton ID="LinkButton1" runat="server">LinkButton</asp:LinkButton> 
</asp:Content> 
 

saeed
Top achievements
Rank 1
 answered on 06 Oct 2012
1 answer
104 views
Hai again,
     Consider this one also. I have a radtreelist with treelistselect column. How can I hide checkboxes in a row based on some condition.
Please help
RT
Shinu
Top achievements
Rank 2
 answered on 06 Oct 2012
1 answer
60 views
Hai,
     How do I apply right-left direction for pager style of treelist.

Thanks
RT
Princy
Top achievements
Rank 2
 answered on 06 Oct 2012
1 answer
76 views
Hi

Is there a way to show inplace editing of radgrid items on check of checkbox inside template column
Shinu
Top achievements
Rank 2
 answered on 06 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?