Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
180 views
Hi,

I am using RadEditor to display my content from database. On a client side button click event, i should know whether the content in the editor been modified or not. I have used the following code which is working when user tries to add/modify the content using key input. But same was not  working when user drags and drops the content in the editor. I have used mousedown event but it is not firing.

I have taken variable"hdnIsContentChange" which is initially set to false, when user tries to modify the data i am comparing the intial content of the editor with new value which i put in hidden variables.

"onkeyup" is the only event is working, the rest are all not working.

var hdnIsContentChange = false;
function Editor_OnClientLoad(Editor, args)
{
        Editor.attachEventHandler ("onmouseup", ContentChange);  //not working
        Editor.attachEventHandler ("onmousedown", ContentChange);//not working
        Editor.attachEventHandler ("ondrag", ContentChange);//not working
        Editor.attachEventHandler ("onchange", ContentChange);//not working
        Editor.attachEventHandler ("onkeyup", ContentChange);//working
       
        function ContentChange()
        {
            $get("hdnNewContent").value = radEditor.get_html();
            
             if($get("hdnInitialContent").value != $get("hdnNewContent").value)
                    get("hdnIsContentChange").value = true;
       }
 }

Please let me whether this approach is correct or already is there any way to know the content been modified by using editor's built-in functions or properties.
Marin Bratanov
Telerik team
 answered on 31 Mar 2014
4 answers
116 views
Hi,

I currently have the ASP.NET version of the RadSpell, which uses the Telerik.Web.UI.dll. This is currently used in an exsiting website.

The site is in the process of being upgraded to use MVC, and we want to use the RadSpell functionality.

I have created an .ascx to contain the RadSpellChecker and made some modiications to the web.config file which you can see below. The ascx loads fine in a Html.Partial().

However when javascript hits the startSpellCheck(); I get the following error :

Object doesn't support this property or method

How can I get this working?

ASCX file:
<%@ Control CodeBehind="spellcheck.ascx.cs" Language="C#" AutoEventWireup="true" Inherits="TargetedEmailMVC.Web.Views.BroadcastTemplate.spellcheck" %>
<%@ Register TagPrefix="telerik" Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" %>
 
<script type="text/javascript" language="javascript">
    function spellCheck() {
        var spell = $('#<%= RadSpellChecker1.ClientID %>');
        if (spell != null) {
            spell.startSpellCheck();
        }
    }
</script>
 
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"/>
<telerik:RadSpell id="RadSpellChecker1" runat="server" buttontype="None" IsClientID="true" HandlerUrl="~/Telerik.Web.UI.DialogHandler.axd"/> 

My web.config contains the following:

HttpHandlers:
<httpHandlers>
  <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false"/>
  <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false"/>
  <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false"/>
</httpHandlers>

Handlers:
<handlers>
  <remove name="UrlRoutingHandler"/>
  <remove name="WebServiceHandlerFactory-Integrated"/>
  <remove name="ScriptHandlerFactory"/>
  <remove name="ScriptHandlerFactoryAppServices"/>
  <remove name="ScriptResource"/>
  <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode"/>
  <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode"/>
  <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode"/>
  <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
  <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
  <add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
  <add name="UrlRoutingHandler" verb="*" path="UrlRouting.axd" preCondition="integratedMode" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</handlers>

Thanks
Jeffrey
Top achievements
Rank 1
 answered on 31 Mar 2014
2 answers
119 views

I'm having an issue with multi-day appointments that span the date on which Greenwich Mean Time (GMT) changes to British Summer Time (BST).

The attached screenshots show:

  1. The creation of an all day appointment which starts on 24th March 2014 and ends on 6th April 2014
  2. A Week view for the Week Commencing 24th March
  3. A Week view for the Week Commencing 31st March
  4. A Month View for March
  5. A Month View for April
  6. The record from the Appointments table (in SQL)

GMT changes to BST on Sunday 30th March.

Note that, in the Week view for the Week Commencing 24th March, the appointment does not display for Sunday 30th March but in the Month View for March, it does.

The RadScheduler control is defined as follows in the markup:

            <telerik:RadScheduler ID="RadScheduler1" runat="server" DataSourceID="AppointmentsDataSource" DataKeyField="ID" DataSubjectField="Subject" DataDescriptionField="Description" DataStartField="Start" DataEndField="End" Culture="en-GB" FirstDayOfWeek="Monday" LastDayOfWeek="Sunday" SelectedView="WeekView" DisplayRecurrenceActionDialogOnMove="false" EnableExactTimeRendering="True" MinutesPerRow="150" TimeZoneID="GMT Standard Time" DayStartTime="08:00:00" DayEndTime="18:00:00" WorkDayStartTime="08:00:00" WorkDayEndTime="18:00:00" EnableDescriptionField="True" HoursPanelTimeFormat="HH:mm" OverflowBehavior="Expand" RenderMode="Auto" StartInsertingInAdvancedForm="True" DataReminderField="Reminder" ResolvedRenderMode="Classic" Localization-ContextMenuAddAppointment="New Absence or On Call Entry" ShowFooter="False" AppointmentStyleMode="Default" RowHeight="35px" CustomAttributeNames="CreatedBy, CreatedDate, LastModifiedBy, LastModifiedDate" TimeZoneOffset="01:00:00">

                <ExportSettings>

                    <Pdf PageBottomMargin="1in" PageLeftMargin="1in" PageRightMargin="1in" PageTopMargin="1in" />

                </ExportSettings>

                <AdvancedForm Modal="True" TimeFormat="HH:mm" DateFormat="dd/MM/yyyy" Width="90%"></AdvancedForm>

                <WeekView DayStartTime="08:00:00" DayEndTime="18:00:00" WorkDayStartTime="08:00:00" WorkDayEndTime="18:00:00" EnableExactTimeRendering="True" ColumnHeaderDateFormat="dddd dd MMMM yyyy"></WeekView>

                <DayView DayStartTime="08:00:00" DayEndTime="18:00:00" WorkDayStartTime="08:00:00" WorkDayEndTime="18:00:00" EnableExactTimeRendering="True"></DayView>

                <MultiDayView DayStartTime="08:00:00" DayEndTime="18:00:00" WorkDayStartTime="08:00:00" WorkDayEndTime="18:00:00" EnableExactTimeRendering="True" />

                <MonthView HeaderDateFormat="MMMM, yyyy" FirstDayHeaderDateFormat="dd MMMM" AdaptiveRowHeight="True" VisibleAppointmentsPerDay="25"></MonthView>

                <TimelineView UserSelectable="False" />

                <AgendaView UserSelectable="True" ResourceMarkerType="None" ReadOnly="True" ShowResourceHeaders="False" />

                <TimeSlotContextMenus>

                    <telerik:RadSchedulerContextMenu>

                        <Items>

                            <telerik:RadMenuItem Text="New Absence or On Call Entry" Value="CommandAddAppointment"></telerik:RadMenuItem>

                            <telerik:RadMenuItem Text="Go to Today" Value="CommandGoToToday"></telerik:RadMenuItem>

                        </Items>

                    </telerik:RadSchedulerContextMenu>

                </TimeSlotContextMenus>

                <ResourceTypes>

                    <telerik:ResourceType KeyField="ID" Name="Category" TextField="Category" ForeignKeyField="CategoryID" DataSourceID="CategoriesDataSource"></telerik:ResourceType>

                </ResourceTypes>

                <AppointmentTemplate>

                    <div style="position:relative;top:4px">

                        <%# Eval("Subject") & " (" & Eval("Category.Text") & ")"%>

                    </div>

                </AppointmentTemplate>

                <AdvancedEditTemplate>

                    <scheduler:AdvancedForm runat="server" ID="AdvancedEditForm1" Mode="Edit" Subject='<%# Bind("Subject") %>' Description='<%# Bind("Description") %>' Start='<%# Bind("Start") %>' End='<%# Bind("End") %>' CategoryID='<%# Bind("Category") %>' />

                </AdvancedEditTemplate>

                <AdvancedInsertTemplate>

                    <scheduler:AdvancedForm runat="server" ID="AdvancedInsertForm1" Mode="Insert" Subject='<%# Bind("Subject") %>' Start='<%# Bind("Start") %>' End='<%# Bind("End") %>' Description='<%# Bind("Description") %>' CategoryID='<%# Bind("Category") %>' />

                </AdvancedInsertTemplate>

                <TimeSlotContextMenuSettings EnableDefault="true"></TimeSlotContextMenuSettings>

                <AppointmentContextMenuSettings EnableDefault="true"></AppointmentContextMenuSettings>

            </telerik:RadScheduler>

Please could you advise what the problem might be.

Boyan Dimitrov
Telerik team
 answered on 31 Mar 2014
1 answer
210 views
I have a page that sits inside a master page so I do not have a body to do an onload statement, by research everyone says use the registerstartUpscript and it will work, however it is not.  How can I call a radwindow on page load from a page nested in a master site.  Thanks


function SelectInfo() {
            $find('<%=rwInfo.ClientID%>').show();
       }
 
 
<telerik:RadWindow ID="rwInfo" runat="server" Modal="true" NavigateUrl="Info.aspx" Width="1000px" Height="800px" OnClientClose="closeWindow"></telerik:RadWindow>
 
 
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
      If Not IsPostBack Then
          Dim userlogon As String = Split(Current.User.Identity.Name, "\")(1)
          HFUserId.Value = GetUserId(userlogon)
 
          If CheckIMOs(userlogon) = True Then
              Dim page As Label = CType(Master.FindControl("lblPage"), Label)
              page.Text = " - Move Add Change"
              ScriptManager.RegisterStartupScript(page, page.GetType(), "SomestartupScript", "SelectInfo();", True)
          Else
              Response.Redirect("~/ErrorPages/AdminError.aspx")
          End If
      End If
  End Sub
Marin Bratanov
Telerik team
 answered on 31 Mar 2014
1 answer
68 views
I'm excited to see what we are going to be able to do with this control in the future, but it seems like it needs a bit of refinement to make it to prime time.

I am wondering how to disable the creation and use of the freaking LoadingPanel.  I am using ImageGallery with LoopItems="true", and have nice animations defined, but the transitions are absolutely jarring because a LoadingPanel appears for a split second before every animation. Since the gallery is set to loop, and it has loaded all of it's images, there is absolutely no reason for a loading panel to be displayed at all. Since I didn't add it, I don't see why it would be there at all, either. The panel is displayed momentarily if you press the next or previous image buttons, as well. You can actually see it on your demo pages quite clearly.

As far as I'm concerned, the fact that it tries to show the LoadingPanel for an image that is available is a bug.

I tried setting RadImageGallery.LoadingPanel.Enabled = false, but that doesn't do anything. Setting RadImageGallery.LoadingPanel.Visiable = false breaks the slideshow altogether.  I tried RadImageGallery.LoadingPanel.Controls.Clear() and that does nothing ether. How can I get rid of it?

Joel
Kostadin
Telerik team
 answered on 31 Mar 2014
65 answers
1.4K+ views
Looks like this is a bug in RADAjaxManager and I havent been able to find a suitable workaround

1. I have a page with a button and a asp panel control.
2. The page has been Ajaxified using the RADPrometheus Ajax Manager.
3. Click of button triggers dynamic load of a user control into the panel
4. The user control includes webusercontrol.js file via Script Manager Proxy.
5. User control has a button and a text box
6. Button click has been wired to call a setTest() js function defined in webusercontrol.js
7. When the page renders, I click the button to dynamically load the user control into the panel.
8. Clicking the button on the user control to set the text results in "Object required" error. What is happening is that the setText() function defined in the included script file is not visible.

//// Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TelerikAjaxTest._Default" EnableEventValidation="false" %>

<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<!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>Telerik Prometheus RADAjaxManager Text</title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"
        EnablePartialRendering="true"
        EnablePageMethods="true"
        LoadScriptsBeforeUI="true">
        <Scripts></Scripts>
    </asp:ScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="btnLoadControl">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlContent" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
       
    </telerik:RadAjaxManager>
    <div>
        <asp:Button ID="btnLoadControl" runat="server" Text="Load Control" />
    </div>
    <div>
        <asp:Panel ID="pnlContent" runat="server"></asp:Panel>
    </div>
    </form>
</body>
</html>

////// Default.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace TelerikAjaxTest {
    public partial class _Default:System.Web.UI.Page {
        protected void Page_Load(object sender, EventArgs e) {
            this.btnLoadControl.Click += new EventHandler(btnLoadControl_Click);
        }

        void btnLoadControl_Click(object sender, EventArgs e) {
            this.pnlContent.Controls.Clear();
            UserControl uc;
            uc = Page.LoadControl("WebUserControl1.ascx") as UserControl;

            if (uc != null) {
                this.pnlContent.Controls.Add(uc);
            }

        }
    }
}

//// WebUserControl1.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl1.ascx.cs" Inherits="TelerikAjaxTest.WebUserControl1" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
    <Scripts>
        <asp:ScriptReference Path="WebUserControl.js" NotifyScriptLoaded="true" />
    </Scripts>
</asp:ScriptManagerProxy>
<div>
    Web User Control with Script Manager Proxy
    This controls is loaded dynamically via the click of the button on
    the main page
</div>
<div>
    <button id="btnAddText" runat="server" onclick="setText">Set Text</button>
</div>
<div>
    <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
</div>
<script type="text/javascript">
    var txtNameId=<%= txtName.ClientID %>;
   
    alert('WebUserControl1.ascx');
</script>

////// WebUserControl.js
// WebUserControl.js

function setText(){
    var oTxt=$get(txtNameId);
    if((oTxt!=null)&&(typeof(oTxt)!='undefined')){
        oTxt.value=oTxt.value+'Some Text';
    }
}

// Notify the AJAX framework that this script has completed loading.
// Making this the last line in the file ensures that this is executed
// last
if(typeof(Sys) !== "undefined")Sys.Application.notifyScriptLoaded();





Any feed back appreciated

thanks
zaphod
Maria Ilieva
Telerik team
 answered on 31 Mar 2014
3 answers
233 views
Here is my code.     

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1" UpdatePanelsRenderMode="Inline">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="pagerMetadata">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rlvMetadata" UpdatePanelRenderMode="Inline" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>

but I lost css in aspx side. I tried add UpdatePanelsRenderMode="Inline" propert but nothing changed. how can I do that using c#?
Maria Ilieva
Telerik team
 answered on 31 Mar 2014
1 answer
54 views
We have a custom class OurGrid that inherits from Telerik.Web.UI.RadGrid. We do some initial setup of the RadGrid options when a grid is added to a page using our custom type so we do not have to re-run the initialization in various places. 

In attempting to persist this using the persistence manager it appears it's grabbing the type of the object and in this case is seeing our custom type rather than RadGrid.

The error message is:
The control of CustomTelerikObjects.OurGrid could not be persisted. Please review the online documetation for the supported controls.

Is there a way around this that anyone has used?
Kostadin
Telerik team
 answered on 31 Mar 2014
2 answers
69 views
Hi Devoloper Friends;

I'm using a radgird and entry in the properties rowselected feature is activated, 
At the same time, right-click the 'Menu' open. 
I click on the DataKeyNames property value of the row you want to get mss. 
If more than one row is selected, it brings me the value of the first selected row.

Example;

http://elbisemoda.com/Bilgi/RadGridRightClick.png


JavaScript;

function RowContextMenu(sender, eventArgs) {
           var menu = $find("<%=RadMenu1.ClientID %>");
           var evt = eventArgs.get_domEvent();
 
           var index = eventArgs.get_itemIndexHierarchical();
           sender.get_masterTableView().selectItem(sender.get_masterTableView().get_dataItems()[index].get_element(), true);

           menu.show(evt);
 
           evt.cancelBubble = true;
           evt.returnValue = false;
 
           if (evt.stopPropagation) {
               evt.stopPropagation();
               evt.preventDefault();
           }
 
 
       }


RadGird;
<telerik:RadGrid ID="grdVeresiyeFisList" AllowFilteringByColumn="false" Height="445px" AutoGenerateColumns="false" runat="server" AllowMultiRowSelection="True" EnableAjaxSkinRendering="True" Culture="tr-TR"
                    GridLines="None" EnableLinqExpressions="False" Skin="Metro" PagerStyle-Visible="false" OnItemCommand="grdVeresiyeFisList_ItemCommand" OnItemDataBound="grdVeresiyeFisList_ItemDataBound"
                    OnNeedDataSource="grdVeresiyeFisList_NeedDataSource" OnDetailTableDataBind="grdVeresiyeFisList_DetailTableDataBind" ShowStatusBar="True" EnableHeaderContextMenu="True" CellPadding="0" CellSpacing="0" ShowFooter="true">
 
                    <HeaderStyle Width="150px" CssClass="cagdasGridHeader"></HeaderStyle>
                    <MasterTableView DataKeyNames="VeresiyeMasterID" NoMasterRecordsText="Kayıt bulunamadı." AllowSorting="True" TableLayout="Auto">
                         
                        <Columns>                          
                            <telerik:GridClientSelectColumn UniqueName="chkSelectColumn" HeaderStyle-Width="30px"></telerik:GridClientSelectColumn>
                            <telerik:GridBoundColumn DataField="VeresiyeMasterID" HeaderText="VeresiyeMasterID" ShowFilterIcon="false" Display="false" UniqueName="VeresiyeMasterID" AllowFiltering="false"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="FisAdi" HeaderText="Fis Adı" UniqueName="FisAdi" HeaderStyle-Width="100px" AllowFiltering="false"></telerik:GridBoundColumn>
                          .......
                          ........
                        </Columns>
                    </MasterTableView>
                    <ClientSettings AllowColumnHide="True" AllowColumnsReorder="True" AllowKeyboardNavigation="True"
                        AllowDragToGroup="True" ReorderColumnsOnClient="True" EnableRowHoverStyle="True">
                        <ClientEvents OnRowContextMenu="RowContextMenu" />
                        <Animation AllowColumnReorderAnimation="true" ColumnReorderAnimationDuration="200" />
 
                        <Selecting AllowRowSelect="true"></Selecting>
 
                        <Scrolling AllowScroll="true" UseStaticHeaders="true"></Scrolling>
                        <Resizing AllowColumnResize="True" AllowRowResize="false" ClipCellContentOnResize="True"
                            EnableRealTimeResize="True" AllowResizeToFit="True"></Resizing>
                    </ClientSettings>
 
                </telerik:RadGrid>
Viktor Tachev
Telerik team
 answered on 31 Mar 2014
16 answers
110 views
In our project, we use Rad Panel Bar and Rad Panel Item to hold labels, check box and radio button with expand and collapse feature.

When a panel gets expanded, labels and controls are missing most of the times and if we collapse and expand then it appears.

Please advise how to make the appearance consistent always.

Thanks
Sudhakar
Plamen
Telerik team
 answered on 31 Mar 2014
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?