Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
88 views
Hi,

Here is my code :

Protected Sub RadButton1_Click(sender As Object, e As System.EventArgs) Handles RadButton1.Click
           Dim sql = (From p In DbContext.VUE_BACKOFFICE_INTERFACE_PHOTOs Select p Where p.etablissement.Contains(RadTextBox1.Text) Or p.titre.Contains(RadTextBox1.Text) Or p.description.Contains(RadTextBox1.Text) Or p.copyright.Contains(RadTextBox1.Text) Or p.tag.Contains(RadTextBox1.Text) Or p.sous_collection.Contains(RadTextBox1.Text) Order By p.id_photo Descending)
        If sql.Count <> 0 Then
            RadFilter1.RootGroup.Expressions.Clear()
            RadFilter1.RootGroup.GroupOperation = RadFilterGroupOperation.Or
            For Each result In sql
                Dim expr1 As New RadFilterEqualToFilterExpression(Of Integer)("id_photo")
                expr1.Value = result.id_photo
                RadFilter1.RootGroup.AddExpression(expr1)
            Next
            RadFilter1.RecreateControl()
            RadFilter1.FireApplyCommand()
        End If
    End Sub

Lets say that my query return 1500 records, 1500 lines/rows will be added to the RadFilter which cause the page to freeze and it goes nowhere.
Not only the page freeze but my whole website become unresponsive.

How would you deal with that ? How many rows can handle the Rafilter component (approximately).

Right now i'm doing a If sql.Count > 100 Then do nothing but I'd like to have your feedback on such a situation

Thank You
Arnaud
Antonio Stoilkov
Telerik team
 answered on 08 Oct 2012
1 answer
204 views
Hi,
I am trying to assign value to Radnumeric textbox from jquery on change() event of same textbox.  
But its not working fine. If i replace teleik textbox to asp textbox its working fine.

MyCode.aspx
<script type="text/javascript">
    $(document).ready(function() {
        $('#<%= txtAmount.ClientID %>').change(function() {
$('#<%= txtAmount.ClientID %>').val(123);
}
})
    });
</script>
 
 
<telerik:RadNumericTextBox ID="txtAmount" ShowSpinButtons="false" Type="Number" runat="server"
                    InvalidStyleDuration="100" Width="200">
                    <NumberFormat DecimalDigits="2" DecimalSeparator="." AllowRounding="true" KeepNotRoundedValue="False" />
                </telerik:RadNumericTextBox>

Please check and let me know.
Thanks,
Abhi
Princy
Top achievements
Rank 2
 answered on 08 Oct 2012
0 answers
49 views
 See my screen shot.
 I have typed in Group code/name in Initial Caps.
 how to data Insert in same method(For Initial Caps)
 
This my coding
if (e.CommandName == RadGrid.PerformInsertCommandName)
            {
                if (e.Item is GridEditFormItem)
                {
                   GridEditFormItem item = (GridEditFormItem)e.Item;
                    RadTextBox groupcode = (RadTextBox)item.FindControl("groupcode");
                    RadTextBox groupname = (RadTextBox)item.FindControl("groupname");

                    oDSGroupMaster.groupcode = groupcode.Text;
                    oDSGroupMaster.groupname = groupname.Text;
                    oDSGroupMaster.status = "ADD";
                }
           }
Tamim
Top achievements
Rank 1
 asked on 08 Oct 2012
5 answers
200 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
726 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
166 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
130 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
112 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
95 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
213 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
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?