Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
130 views

We are using "RadInput.Net2.dll" and RadMaskedTextBox for phone number. We want to check if first character of area code should not be 0 or 1.

If we use CustomValidator and javascript as below, it is working fine.
For example, if phone # is "(316) 446-2777" and if I replace 3 as 1, I could see the correct error message. But if I delete 3, I can see numbers in text box as "(_16) 446-2777". But still I can see the error message as "This number cannot begin with a 1 or 0.". The prompt character is not part of the args.value.

I want to display the error message only if first character after ( is 0 or 1. Could you please help us to find out the first character only of the input text
Thanks in advance.

<radI:RadMaskedTextBox ID="txtPhone" runat="server">
             </radI:RadMaskedTextBox><br />          
              
            <asp:CustomValidator id="revBusinessPhone" Display="dynamic" runat = "server" ControlToValidate="txtPhone"  ErrorMessage = "This number cannot begin with a 1 or 0." ClientValidationFunction ="validateLength"  ></asp:CustomValidator>
  
  
  
   function validateLength(oSrc, args) {
  
         var phnVal = args.Value;
        
         if (((phnVal1.substring(0, 2)) == "(1" || (phnVal.substring(0, 2) == "(0"))) {
             oSrc.innerText = "This number cannot begin with a 1 or 0.";
              args.IsValid = false;
  
         }
         else {
         var regex = /^(\([0-9]\d{2}\)|[0-9]\d{2})[- .]?\d{3}[- .]?\d{4}$/;
            if (regex.test(phnVal)) {
                  args.IsValid = true;
             }
             else {
                 oSrc.innerText = "This number must contain 10 digits.";
                  args.IsValid = false;
             }
         }
         return true;
     }
Rhbkv
Top achievements
Rank 1
 answered on 15 Mar 2012
3 answers
78 views
Currently when I click on an appointment to drag it it moves to cover the topmost appointment and goes semi-transparent.
After I have moved the cursor to the position I want the appointment to be in and released the mouse button it just jumps back to where it was before.
Is there any way to re-order items and save the order they were in?
Thanks,
Edward
Ivana
Telerik team
 answered on 15 Mar 2012
12 answers
183 views
I have a treeview which I'm loading on demand via a webservice.

My webservice sets attributes on the nodes to indicate a) whether or not to show the checkbox for that node and b) whether or not the checkbox should be checked.

My treeview has 2 levels.

When the WebService call succeeds, the following code is called to populate the tree...

treeView.get_nodes().clear();
  
if (treeNodesResults != null)
{
    for (var i = 0; i < treeNodesResults.length; i++)
    {
        var node = new Telerik.Web.UI.RadTreeNode();
        node.set_text(treeNodesResults[i].Text);
        node.set_value(treeNodesResults[i].Value);
        node.set_expandMode(treeNodesResults[i].ExpandMode);
        node.set_imageUrl(treeNodesResults[i].ImageUrl);
  
        var checkable = false;
        var checkableAttribute = node.get_attributes().getAttribute("Checkable");
        if (checkableAttribute != null)
        {
            checkable = checkableAttribute == "true";
        }
        node.set_checkable(checkable);
  
        if (checkable)
        {
            var checked = false;
            var checkedAttribute = node.get_attributes().getAttribute("Checked") == "true";
            if(checkedAttribute != null)
            {
                checked = checkedAttribute == "true";
            }
            node.set_checked(checked);
        }
  
        treeView.get_nodes().add(node);
    }
}
And, on the face of it, this appears to work.

However, it seems that this code is only being called for the top-level nodes in the tree. None of the child nodes are being processed by this code. In fact, this code doesn't appear to be being called at all for anything other than the top-level nodes.

Clearly, I'm missing something. Can anyone give me an idea about what it might be?

--
Stuart
msigman
Top achievements
Rank 2
 answered on 15 Mar 2012
2 answers
91 views
I intend to implement 'Drag and Drop' in rearranging Tabs at run-time.
I choose to work with the RadGrid's 'Drag and Drop' feature for Column header rearranging. 

Changing the Layout/CSS for every column header item seems doable. But, I need scroll features like in TabStrip without a scrollbar. Any idea how I could do this? 

I am using ASP.NET AJAX Q3 2010 and have upgrade up to Q3 2011.

Thanks,
Shravan
Shravan
Top achievements
Rank 1
 answered on 15 Mar 2012
2 answers
76 views
I have the trial version. I drag and drop the RadUpload onto my page. I do not see the "Upload All" button for uploading the file. Is this due to because it was a trial version only?

I got this error when I tried to load the page with the RadUpload control and RadScriptManager.

Server Error in '/' Application.

'~/Telerik.Web.UI.WebResource.axd' is missing in web.config. RadScriptManager requires a HttpHandler registration in web.config. Please, use the control Smart Tag to add the handler automatically, or see the help for more information: Controls > RadScriptManager

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: '~/Telerik.Web.UI.WebResource.axd' is missing in web.config. RadScriptManager requires a HttpHandler registration in web.config. Please, use the control Smart Tag to add the handler automatically, or see the help for more information: Controls > RadScriptManager

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Plamen
Telerik team
 answered on 15 Mar 2012
1 answer
93 views
Hi,

We are having some problems with the Opera 11 and AutoResize of the RadWindow.
We are setting an url to the window. If the content of the window is small (less than 350px) our RadWindow still becomes 350px high (with white space below).

When checking out the autosize source code in Telerik, I discovered the following lines of code:
            if ($telerik.isIE || $telerik.isFirefox)
            {
                sizingElement = contentFrame;
            }

When I did a prototype on the entire autoSize function and including Opera in the if statement, everything worked as expected!!!
Don't know if there are side-effect of this, but normally Opera behaves like these browsers so it should be OK.

Is this something you might fix in a future release?

Regards
Caesar
Marin Bratanov
Telerik team
 answered on 15 Mar 2012
12 answers
454 views
I'm trying to get a basic Schedule running, but I'm getting an error:

Provider 'SchedulerData' has not been declared in web.config

Here is my web.config section that defines it:

<configuration> 
    <configSections> 
    <sectionGroup name="telerik.web.ui">  
      <section name="radScheduler" type="Telerik.Web.UI.RadSchedulerConfigurationSection, Telerik.Web.UI, PublicKeyToken=121fae78165ba3d4" allowDefinition="MachineToApplication"/>  
    </sectionGroup> 
    </configSections> 
  <telerik.web.ui> 
    <radScheduler defaultAppointmentProvider="Integrated">  
      <appointmentProviders> 
        <add name="SchedulerData" type="Telerik.Web.Scheduler.MyDbSchedulerProvider" connectionStringName="LocalSqlServer" persistChanges="true" /> 
      </appointmentProviders> 
    </radScheduler> 
  </telerik.web.ui> 
    <appSettings/> 
    <connectionStrings> 
        <remove name="LocalSqlServer"/>  
        <add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|sc.mdf"/>  
    </connectionStrings> 

and here's the very basic tag I'm using to initiate it:

<telerik:RadScheduler runat="server" ID="RadScheduler1" SelectedView="Month" DayStartTime="08:00:00" DayEndTime="18:00:00" ProviderName="SchedulerData" ReadOnly="false"

Can anyone see what I'm doing wrong? I'm using the MyDbSchedulerProvider.cs file that was included and I've changed it to match up to my database table and fields. Thanks.
David
Top achievements
Rank 1
 answered on 15 Mar 2012
19 answers
448 views
Hi,

I got a RadUpload Ajax callback error when I put a RadUpload and RadUploadProgressHandler on a web form hosted in IIS7. The error message is as following:

System.NullReferenceException: Object reference not set to an instance of an object. 
    at Telerik.Web.UI.RadProgressContext.Serialize(TextWriter writer) 
    at
Telerik.Web.UI.RadUploadProgressHandler.ProcessRequest(HttpContext context)

Telerik.RadUploadProgressHandler.ashx?RadUrid=......

Did you register the RadUploadProgressHandler in web.config?

Please ....


The error message only appears in a popup message box when the IIS is restarted and the the page is visited (and a button/link is clicked) for the first time. It is not just triggered by an upload. A normal postback gets the same thing. Yet after that it never happens again even when the page is loaded in a seperate browser on a different computer. It does not affect any operations either, but still having an error poped out is not ideal.

I have triple checked my web.config to make sure that I have done everything suggested in the documentation. The fact that this error only happens once at the start suggests that it might have something to do with the way the RadUploadProgressHandler component is registered with the web server or how it is initialized.

Has anyone else here got the similar error? Any suggestions will be appreciated. Thanks.


Kate
Telerik team
 answered on 15 Mar 2012
3 answers
101 views
Hi sir,
Iam using Radscheduler for my batch planner...In Time line View Appointment is showing in wrong slot as shown in attachment
batch no 143 starting from 6th  december but in timeline view appointment is showing from november Where as in other views i.e day view,month view... etc appointment is showing correctly.i traced it in appointment data bound event using debugger ...the appointment start time is showing correctly...but not dispalying correctly(only in timeline view) below is the code i written.


<telerik:RadScheduler runat="server" ID="RadScheduler1"  SelectedDate="01/01/2011" al <br>        SelectedView="TimelineView" DayEndTime="19:00:00" DataKeyField="BatchNo" DataDescriptionField="BatchNo" <br>        DataStartField="StartDate" DataEndField="EndDate" DataSubjectField="StartDate" <br>            OverflowBehavior="Expand" DataSourceID="DetailsDataSource" Height="" ReadOnly="true"><br>            <AdvancedForm Modal="false" /><br>             <AppointmentTemplate><br>            <asp:Label ID="Label2" Text="BatchNo:" runat="server"><%#  Eval("Description")%></asp:Label>&nbsp;&nbsp;<br>            <asp:Label ID="EndDate" Text="StartDate:" runat="server"><%#  Eval("Start").ToString().Split(' ')[0] %></asp:Label>&nbsp;&nbsp;<br>            <asp:Label ID="lblEnddate" runat="server"></asp:Label><br>             </AppointmentTemplate><br>            <ResourceTypes><br>                <telerik:ResourceType KeyField="BatchNo" Name="Batch" ForeignKeyField="BatchNo" TextField="BatchNo"<br>                    DataSourceID="DetailsDataSource"/><br>            </ResourceTypes><br>            <TimelineView UserSelectable="true" HeaderDateFormat="MMM-yyyy" ShowResourceHeaders="true" ShowInsertArea="false"  ReadOnly="true" SlotDuration="31:00:00"  ColumnHeaderDateFormat="MMM" NumberOfSlots="12" GroupBy="Batch" GroupingDirection="Vertical" /><br>            <MultiDayView UserSelectable="true" /><br>            <DayView UserSelectable="true" /><br>            <WeekView UserSelectable="true" /><br>            <MonthView UserSelectable="true" /><br>        </telerik:RadScheduler>
related events
protected void Page_Load(object sender, EventArgs e)<br>    {<br>        ClientScript.RegisterStartupScript(this.GetType(), "abc", "pageload();", true);//Registering client side page load function<br>        RadScheduler1.AppointmentDataBound += new Telerik.Web.UI.AppointmentDataBoundEventHandler(RadScheduler1_AppointmentDataBound);<br>        RadScheduler1.AppointmentCreated += new Telerik.Web.UI.AppointmentCreatedEventHandler(RadScheduler1_AppointmentCreated);<br>        RadScheduler1.SelectedDate = DateTime.Now.Date;<br>    }<br><br>    void RadScheduler1_AppointmentCreated(object sender, Telerik.Web.UI.AppointmentCreatedEventArgs e)<br>    {<br>        if (e.Appointment.ID != null)<br>        {<br>            Label Enddate = e.Container.FindControl("lblEnddate") as Label;<br>            Enddate.Text = "End date:" + e.Appointment.End.AddDays(-1).ToShortDateString();<br>        }<br>    }<br><br>   void RadScheduler1_AppointmentDataBound(object sender, Telerik.Web.UI.SchedulerEventArgs e)<br>    {<br>        if (e.Appointment.ID != null)<br>        {<br>            e.Appointment.ToolTip = "StartDate:" + e.Appointment.Start.ToShortDateString() + " " + "EndDate:" + e.Appointment.End.ToShortDateString();<br>          //  e.Appointment.End = e.Appointment.End.AddDays(1);<br>        }<br>    }
please give me a solution for this ASAP as it is already in production


Thanks
Rajesh


  
Plamen
Telerik team
 answered on 15 Mar 2012
4 answers
75 views
Hey folks,

Why is it in my scheduler project that there's always a cell on the month view calendar that is styled as today's date, even if I am not on the correct month?

For example, I am viewing July 2011 and July 18th is styled as today's date.

For some reason the TodayCell class is getting assigned to some cells incorrectly.

I am using the 2011.1.413.40 DLL.

regards,
Plamen
Telerik team
 answered on 15 Mar 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?