Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
529 views

Hi,
I have a problem with the Radeditor and counting the length of the text inside it. When I use a JavaScript with the get_text() function the length is different from when I use Radeditor.Text.Length in code behind. I want both for client and server side validation.

It seems like they count Enter key differently. Radeditor.Text.Length count them as two characters regardless how many I use. So one Enter key is two chars and five enter key is also two chars. It trims it down or something.

The JavaScript count every enter key as one characters unless it’s a line with no text between two lines with text, then it counts that enter key as two characters.

This is my code and everything is working fine it’s just that they are counting different when it comes to enter key.

//Validates the length against the maxlength allowed
_radEditorLengthCheck: function (sender, args) {
 
       //Gets the maxLength property in my settings class
       var maxLength = this.data.maxLength;
 
       if (maxLength > 0) {
           var editor = this.data.controls.get_editor();
           var value = editor.get_text();
           args.IsValid = value.length <= maxLength;          
       }
       else {
           args.IsValid = true;
       }
   },

 

//Updates a label counter so the user can se how many characters when blur
handle_blur: function (sender, args) {
       var countlabel = this.data.objects.windowOriginalValue.data.controls.get_charCounter();
       var editor = this.data.controls.get_editor();
       var element = editor.get_contentArea();
 
       $telerik.addExternalHandler(element, "blur", function (e) {      
           var value = editor.get_text();          
           countlabel.innerHTML = value.length;
       });
   }

 

//Client side validator
protected void EditorLengthValidator_ServerValidate(object source, ServerValidateEventArgs args)
   {
           // force Text-property to update
           Radeditor.Content = Radeditor.Content;
 
           string noHTML = Radeditor.Text;
           args.IsValid = noHTML.Length <= MaxLength;
 
           //Update the Label that shows the count
           LCounterChars.InnerText = noHTML.Length.ToString();
   }

 

Ianko
Telerik team
 answered on 13 Dec 2016
4 answers
71 views

Hi

We have recently updated our web project .net framework from 4.0 to 4.6.1. After the changes we noticed that 'radCalendar' popup displays strange characters for 'NextMonth/PrevMonth' controls. The tool-tip(title attribute) in those controls shows the same strange characters. Please see attached screenshot. Could you please advice how we could resolve this.

 

Eyup
Telerik team
 answered on 13 Dec 2016
1 answer
84 views
Hi, I am having strange behavior using the RadFilterDateFieldEditor, where although the pop-up does display, it is locked November 1994.  Other dates can't be selected nor can other years, but the text box allows data entry.  When I switch from EqualTo to Between operator, the second text box displays, but when DatePicker is clicked, 'Date Out Of Range' error. I have used Firefox and Chrome, and I get this error;  IE will not load the page, as Javascript errors prevent loading.  Any ideas would be helpful.  Thanks.  Steve
Steve
Top achievements
Rank 1
 answered on 12 Dec 2016
1 answer
222 views

I am recently updated a web app to visual studio 2013..  When I check in Tools/Extensions and Updates I see Telerik ASP.NET AJAX vs Extentions version 2016.2.603.0. 

When I view one of my web pages in the design view all of the RAD Controls have this error message:
EmployeeSectionError Creating Control - rcbAccusedFailed to create designer 'Telerik.Web.UI.RadComboBox, Telerik.Web.UI, Version=2010.2.929.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4' 

Why is version 2010 being refrefenced in the error messge?

However the application will run and all of the controls work.

Why do I see this error message in design view and how can I fix it?

Rumen
Telerik team
 answered on 12 Dec 2016
3 answers
164 views

Hello,

I'm using Telerik RadEditor version 2015.1.401.35 on Chrome v54. When I add a link using Hyperlink Manager giving it an email address and a text, which is the same as the email address, the link doesn't show, but if the user hovers the mouse over the link then it shows, when moving the mouse away it hides again. Is there a fix for this issue?

Regards

Vessy
Telerik team
 answered on 12 Dec 2016
3 answers
132 views
Hi,I am using the RadFilter with no real issues, except that the display width of the dropdown in  RadFilterDropDownEditor is too small (I mean, it makes no attempt to even come close to expanding to fit the text).  Is there a way to specify or change the width of the dropdown, like there is for RadFilterTextFieldEditor?            Thanks
Eyup
Telerik team
 answered on 12 Dec 2016
7 answers
272 views

The page below shows the issue. When I browse to it from a mobile device, such as iPhone or Android, the menus will not drop down. It's appears there's a conflict with hovering vs clicking.

I have other code determining if the user is browsing from a mobile device or not. Knowing that, what code I can apply to my menu that will disable hovering and only make menus drop down when clicking?


<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
 
 
<body style="background-color:White">
 
    <script language="javascript" type="text/javascript">
 
 
        function MenuItemClicking(sender, args) {
 
            var item = args.get_item();
 
            if (item.get_level() === 0) {
                args.set_cancel(true);
                return;
            }
 
            alert('Menu item selected');
 
        }
 
 
    </script>
 
 
    <form id="form1" runat="server">
 
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnablePageMethods="true">
    </telerik:RadScriptManager>
 
 
    <div>
     
        <telerik:RadMenu ID="RadMenu1" runat="server" BorderStyle="None" OnClientItemClicking="MenuItemClicking">
            <Items>
                <telerik:RadMenuItem runat="server" Text="Data" TabIndex="-1">
                    <Items>
                        <telerik:RadMenuItem runat="server" Text="Option 1">
                        </telerik:RadMenuItem>
                        <telerik:RadMenuItem runat="server" Text="Option 2">
                        </telerik:RadMenuItem>
                        <telerik:RadMenuItem runat="server" Text="Option 3">
                        </telerik:RadMenuItem>
                    </Items>
                </telerik:RadMenuItem>
                <telerik:RadMenuItem runat="server" Text="Info" TabIndex="-1">
                    <Items>
                        <telerik:RadMenuItem runat="server" Text="Option 4">
                        </telerik:RadMenuItem>
                        <telerik:RadMenuItem runat="server" Text="Option 5">
                        </telerik:RadMenuItem>
                    </Items>
                </telerik:RadMenuItem>
                <telerik:RadMenuItem runat="server" Text="Help" TabIndex="-1">
                    <Items>
                        <telerik:RadMenuItem runat="server" Text="Option 6">
                        </telerik:RadMenuItem>
                        <telerik:RadMenuItem runat="server" Text="Option 7">
                        </telerik:RadMenuItem>
                    </Items>
                </telerik:RadMenuItem>
            </Items>
        </telerik:RadMenu>
 
    </div>
    </form>
</body>
</html>

Nencho
Telerik team
 answered on 12 Dec 2016
1 answer
98 views

Can you use a variable or a Session["variable"] as the ClientDetailTemplateId value? Or does it have to be a hard-coded string?

Thanks,

Shawn

Eyup
Telerik team
 answered on 12 Dec 2016
11 answers
572 views
Hi,

I am storing Image in Database in binary format. Is it possible to bind Rad Image gallery control to binary images?. Also I want to add this inside RAD Grid, I am binding Grid on NEED DATASOURCE event. please help me.



Thank you.
Konstantin Dikov
Telerik team
 answered on 12 Dec 2016
2 answers
143 views

Hi ,

 

I am radscheduler using Sql data source method.

<telerik:RadAjaxPanel ID="ajaxpanel1" runat="server">
<telerik:RadScheduler Width="940px" runat="server" ID="ASIScheduler" DataDescriptionField="Description"
DataEndField="End" DataRecurrenceParentKeyField="RecurrenceParentID" DataRecurrenceField="RecurrenceRule"
DataKeyField="ID" DataReminderField="Reminder" DataSourceID="SqlDataSource1"
DataStartField="Start" DataSubjectField="Subject"
EnableDescriptionField="True" Height="700px"
SelectedView="MonthView" OnAppointmentDataBound="ASIScheduler_AppointmentDataBound">
<Reminders Enabled="True" />
</telerik:RadScheduler>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DevConnString %>"
SelectCommand="SELECT [ID], [Subject], [start], [End], [RecurrenceRule], [RecurrenceParentID], [Reminder], [Description], [Annotations] FROM [EventCalendar]"
DeleteCommand="DELETE FROM [EventCalendar] WHERE [ID] = @ID" InsertCommand="INSERT INTO [EventCalendar] ([Subject], [Start], [End], [RecurrenceRule], [RecurrenceParentID], [Description],[Reminder]) VALUES (@Subject, @Start, @End, @RecurrenceRule, @RecurrenceParentID, @Description, @Reminder)"
UpdateCommand="UPDATE [EventCalendar] SET [Subject] = @Subject, [Start] = @Start, [End] = @End, [RecurrenceRule] = @RecurrenceRule, [RecurrenceParentID] = @RecurrenceParentID, [Description] = @Description WHERE [ID] = @ID"></asp:SqlDataSource>
</telerik:RadAjaxPanel>

When user tries to add new appointment  , we are getting following error

Must declare the scalar variable "@Description".

 

but when user clicks new appointment and then click on "options" and fill in other details then appointment gets saved.

 

Please advise fix for this.

Sapandeep
Top achievements
Rank 1
 answered on 12 Dec 2016
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?