Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
88 views
i have the following piece of code:

 if (lgSentTo.length > 0) {
                        var temp = new Array();
                        // this will return an array with strings "1", "2", etc.
                        temp = lgSentTo.split(",");
                        for (a in temp) {
                            var site = temp[a].toString().trim();
                            GetRadTreeView().findNodeByText(site).disable();
                            GetRadTreeView().findNodeByText(site).checked = false;
                        }
                    }

while "disable()" works fine, i can't seem to uncheck anything.

i've also tried:   GetRadTreeView().findNodeByText(site).uncheck(); but am also getting nowhere. please assist.
Shinu
Top achievements
Rank 2
 answered on 10 Sep 2013
1 answer
92 views
I have a RedEditor with the ID radEditor1 and the following javascript function:
// Character and Word Counter for Telerik RadEditor
//   Parameters:
//     ID of the RadEditor
//     Maximum number of words allowed
//     Returns false if maxWords is exceeded, true otherwise
 
function LimitWordCount(editorId, maxWords)
{
    var content = $find(editorId).get_text();
    var words = 0;
    var chars = 0;
    LimitWordCount = true;
    if (content) {
        punctRegX = /[!\.?;,:&_\-\-\{\}\[\]\(\)~#'"]/g;
        content = content.replace(punctRegX, "");
        if (content) {
            splitRegX = /\s+/;
            var array = content.split(splitRegX);
            words = array.length;
            chars = content.length;
        }
    }
    if (words > maxWords) {
        alert("Cannot exceed maximum word count.  Please shorten text.\nTo undo a paste, click the undo button at the top of the text area.")
        LimitWordCount = false;
    }
}

I call this function from the following link in a formview:
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Save" CssClass="linkbutton" OnClientClick='LimitWordCount("RadEditor1", 30)' />

When the javascript is hit, $find(editorId) returns null.

How would I get the text in this instance?  I have tried all the examples I can find, but all return null or give some other error. 

Help is appreciated!
Rumen
Telerik team
 answered on 10 Sep 2013
1 answer
44 views
Hello Telerik Team,

We are using telerik editor in our application, in ie9 i am not able to save the information entered in the editor
its working in chrome, firefox and ie8 and lower version browser
Please give me suggestions

Thanks,
Naveen 
Rumen
Telerik team
 answered on 10 Sep 2013
1 answer
112 views
Hi,

I have the latest dll version. Currently we are facing issues with the Treeview control.

When a parent node is selected, all the child nodes get selected but not the Parent node. I have tried with "TriStateCheckboxes = True", unfortunately when I deselect all the child nodes the parent is deselected.

Ex: I have departments and Sub-Departments and I assign employees at all levels. I have to filter on Employees belong to Parent department alone. I select only the Parent Department from the treeview for my filter.

This control was working as expected before we deploy the current dll. 

Please treat this on priority.

Thanks.
Shinu
Top achievements
Rank 2
 answered on 10 Sep 2013
12 answers
171 views
Hi,

I try to create a simple application using Telerik AJAX manager and below is my code:
VisualWebpart.ascx
<telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server" >
      <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="btn">
                 <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="lbl" LoadingPanelID="load1"  />
                 </UpdatedControls>
        </telerik:AjaxSetting>
      </AjaxSettings>
</telerik:RadAjaxManagerProxy>
 
 <asp:label ID="lbl" runat=server />
 <asp:Button ID="btn" runat=server Text="press" onclick="btn_Click" />

In my VisualWebpart.ascx.cs
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

namespace DPA.DPINET.ResourceBooking.View.CalendarVW
{
    public partial class CalendarVWUserControl : UserControl
    {
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            EnsureChildControls();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
           
          
        }

        protected void btn_Click(object sender, EventArgs e)
        {
            System.Threading.Thread.Sleep(3000);
            lbl.Text = DateTime.Now.ToString();
        }
    }
}


In my Master Page:
<asp:ScriptManager id="ScriptManager" runat="server" EnablePageMethods="false" EnablePartialRendering="true" EnableScriptGlobalization="false" EnableScriptLocalization="true" />
 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
   </telerik:RadAjaxManager>
 <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>

My first click it did a postback, but the following click it did ajax call, only thing that the LoadingPanel didnt show up. This code work in normal ASP.NET page, but when try to move to my VisualWebPart annd deploy over to sharePoint 2010, it fail. Please advice.
Plamen
Telerik team
 answered on 10 Sep 2013
2 answers
72 views
Using the various examples of doing inplace editing/updating, I'm running into issues.  I have a radgrid that autogenerates the columns depending upon a question the user selects.  The page unto itself works fine.  The grid gets populated correctly and the inplace editing columns come up just fine.  Just nothing updates when I click the "update" button........

FYI - all columns are numeric double values.

The issue I've seen is that at the "For Each Column In e.Item.OwnerTableView.Columns" loop in the update subroutine, it does not cycle, catch, identify, know that, etc. there are columns in the grid.  I can have 44 autogenerated columns and this For/Next loop only executes once and then moves on.  

Any and all suggestions are more than welcome!

Here is the code on my aspx page:

<telerik:RadGrid ID="rg_GrowthRates" runat="server" AllowSorting="True"
    CellSpacing="0" GridLines="None"
    AllowFilteringByColumn="True" Width="100%"
    AllowPaging="True" PageSize="15"
    EnableViewState="False" ViewStateMode="Disabled" Skin="Metro"
    AllowAutomaticUpdates="True" AutoGenerateEditColumn="True">
    <MasterTableView DataKeyNames="ID_SurveyInstitutional" EditMode="InPlace" >
        <CommandItemSettings ShowAddNewRecordButton="False" />
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn1 column" UniqueName="EditCommandColumn1">
            </EditColumn>
        </EditFormSettings>
        <EditItemStyle BackColor="LightSteelBlue" BorderColor="Black" BorderStyle="Dashed" BorderWidth="1px" HorizontalAlign="Center" VerticalAlign="Middle" Width="50px" />
        <PagerStyle AlwaysVisible="True" PageSizes="15;30;45;60;All" />
        <CommandItemStyle BackColor="#FFFFC0" />
    </MasterTableView>
    <PagerStyle AlwaysVisible="True" PageButtonCount="15" PageSizes="15;30;45;60;All" />
</telerik:RadGrid>

In my code behind I have this as my grid source:

Private ReadOnly Property GridSource As DataTable
    Get
        Dim obj As Object = Me.ViewState("_gds")
        If (Not obj Is Nothing) Then
            Return CType(obj, DataTable)
        Else
            querystring = "SELECT ID_SurveyInstitutional, " & getDatabaseColumns(Session("selectedQuestion")) & " " & _
                            "FROM SurveyInstitutional " & _
                            "WHERE ID_AvailableQuarters = " & Session("selectedQuarter")
 
            RERCDataCenterConnection.Open()
            Dim existingCommand As New SqlCommand(querystring, RERCDataCenterConnection)
            Dim da As New SqlDataAdapter(existingCommand)
            Try
                da.Fill(questionTable)
            Catch ex As Exception
            Finally
                RERCDataCenterConnection.Close()
            End Try
 
            Me.ViewState("_gds") = questionTable
            Return questionTable
        End If
    End Get
End Property

My "getDatabaseColumns" routing (called above) populates the query depending upon the question the user has selected:
Function getDatabaseColumns(ByVal whichQuestion As Integer)
    Dim columnList As New DataTable
    Dim columnString As String = ""
    querystring = "SELECT DatabaseColumn FROM Const_InstitutionalColumnMatrix WHERE ID_Const_EditableQuestions = " & whichQuestion
    RERCDataCenterConnection.Open()
    Using getColumns As New SqlCommand(querystring, RERCDataCenterConnection)
        Dim da As New SqlDataAdapter(getColumns)
        Try
            da.Fill(columnList)
        Catch ex As Exception
        Finally
            RERCDataCenterConnection.Close()
        End Try
    End Using
 
    For Each row As DataRow In columnList.Rows
        columnString = columnString & row("DatabaseColumn") & ", "
    Next
 
    columnString = Left(columnString, Len(columnString) - 2)
    Return columnString
End Function

This is my 'needDataSource':
Private Sub rg_GrowthRates_NeedDataSource(sender As Object, e As GridNeedDataSourceEventArgs) Handles rg_GrowthRates.NeedDataSource
 
    ' If they select "Select a Question from the dropdown then clear the grid
    If CInt(Session("selectedQuestion")) < 1 Then
        rg_GrowthRates.DataSource = New String() {}
        Exit Sub
    End If
 
    rg_GrowthRates.DataSource = Me.GridSource
 
End Sub

This is my update routine:
Private Sub rg_GrowthRates_UpdateCommand(sender As Object, e As GridCommandEventArgs) Handles rg_GrowthRates.UpdateCommand
     
    Dim item As GridEditableItem = DirectCast(e.Item, GridEditableItem)
    Dim currentID As String = item.GetDataKeyValue("ID_SurveyInstitutional").ToString()
 
    Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)
    Dim editMan As GridEditManager = editedItem.EditManager
    Dim column As GridColumn
    For Each column In e.Item.OwnerTableView.Columns
        If TypeOf column Is IGridEditableColumn Then
            Dim editableCol As IGridEditableColumn = CType(column, IGridEditableColumn)
            If (editableCol.IsEditable) Then
                Dim editor As IGridColumnEditor = editMan.GetColumnEditor(editableCol)
                Dim editorText As String = ""
                Dim editorValue As Object = Nothing
                If (TypeOf editor Is GridTextColumnEditor) Then
                    editorText = CType(editor, GridTextColumnEditor).Text
                    editorValue = CType(editor, GridTextColumnEditor).Text
                End If
                If (TypeOf editor Is GridBoolColumnEditor) Then
                    editorText = CType(editor, GridBoolColumnEditor).Value.ToString()
                    editorValue = CType(editor, GridBoolColumnEditor).Value
                End If
                If (TypeOf editor Is GridDropDownColumnEditor) Then
                    editorText = CType(editor, GridDropDownColumnEditor).SelectedText + "; " + CType(editor, GridDropDownColumnEditor).SelectedValue
                    editorValue = CType(editor, GridDropDownColumnEditor).SelectedValue
                End If
                Try
                    Dim changedRows As DataRow() = Me.GridSource.Select("ID_SurveyInstitutional = " + editedItem.OwnerTableView.DataKeyValues(editedItem.ItemIndex)("ID_SurveyInstitutional").ToString())
                    changedRows(0)(column.UniqueName) = editorValue
                    Me.GridSource.AcceptChanges()
                Catch ex As Exception
                    e.Canceled = True
                End Try
                processEdits(column.UniqueName, editorValue, currentID)
            End If
        End If
    Next
 
    rg_GrowthRates.MasterTableView.ClearEditItems()
 
End Sub

And finally, my 'processEdits' routine:
Protected Sub processEdits(ByVal columnName As String, ByVal newVal As String, ByVal currentID As Integer)
    Dim valueToUpdate As Double
    If Not IsDBNull(newVal) And Trim(newVal) <> "" Then
        valueToUpdate = CDbl(newVal)
 
        querystring = "UPDATE SurveyInstitutional " & _
                        "SET " & columnName & " = " & valueToUpdate & " " & _
                        "WHERE ID_SurveyInstitutional = " & CInt(currentID)
    Else
        RERCDataCenterConnection.Close()
        Exit Sub
    End If
 
    RERCDataCenterConnection.Open()
    Dim processEditAction As New SqlCommand(querystring, RERCDataCenterConnection)
    processEditAction.ExecuteNonQuery()
    RERCDataCenterConnection.Close()
    rg_GrowthRates.EditIndexes.Clear()
    rg_GrowthRates.Rebind()
End Sub
Angel Petrov
Telerik team
 answered on 10 Sep 2013
3 answers
69 views
Dear all,
i have an asp.net application that uses grid view with data pager everything great except that when i filter the grid the data pager total request event run first on the server side 
that cause me a problem because i cant get the totalrowcount because the  Grid FilterExpression is null 
so the rad data pager run first then the page load event then the grid pre_render event
anyway how to make the data pager not running first

regards
Konstantin Dikov
Telerik team
 answered on 10 Sep 2013
6 answers
321 views
Hi,

I am using RadControl Q1 2009.

I am using the radscheduler control.

In monthview i have set the

MonthVisibleAppointmentsPerDay="1"

If there are more than two appointment in that day it shows 'show more' link in date column.

How can i hide the 'show more' link from montview date column?

Thanks



Plamen
Telerik team
 answered on 10 Sep 2013
1 answer
81 views
I am trying to create a custom filter for my radeditor and I keep receiving the following error message:

Javascript runtime error: Unable to get the property 'Filter' of undefined or null reference

The error occurs on this line of code

RadEditorCustomFilter.registerClass('RadEditorCustomFilter', Telerik.Web.UI.Editor.Filter);
Ianko
Telerik team
 answered on 10 Sep 2013
4 answers
102 views
Hi,

I have a Problem with the Telerik AsyncUpload Control. I'm using VS2010 Pro.

When I'm using this control in a single Webpage it works:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
 
<!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>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <div>
 
    </div>
     
    <telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server"
        MultipleFileSelection="Automatic" TargetFolder="C:\TEMP">
    </telerik:RadAsyncUpload>
    <telerik:RadProgressArea ID="RadProgressArea1" runat="server">
    </telerik:RadProgressArea>
    <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Upload" />
    </form>
</body>
</html>

when I'm adding a masterpage it throws me an error (see screenshot).
Here is the Code of the masterpage:
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site1.master.cs" Inherits="WebAppTelerik2.Site1" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title> TEST </title>
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
    <asp:Label ID="lbltest" runat="server" Text="Test Label" />
    <div>
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
         
        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>

and the code of the contentpage:
<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebAppTelerik2.ChildPage" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    <Scripts>
        <asp:ScriptReference Assembly="Telerik.Web.UI"
            Name="Telerik.Web.UI.Common.Core.js">
        </asp:ScriptReference>
        <asp:ScriptReference Assembly="Telerik.Web.UI"
            Name="Telerik.Web.UI.Common.jQuery.js">
        </asp:ScriptReference>
        <asp:ScriptReference Assembly="Telerik.Web.UI"
            Name="Telerik.Web.UI.Common.jQueryInclude.js">
        </asp:ScriptReference>
    </Scripts>
</telerik:RadScriptManager>
<telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server" ChunkSize="0">
</telerik:RadAsyncUpload>
</asp:Content>

Do anyone have an idea whats the Problem.

I don't understand, why it's throwing the error and why it wants to load a SharePoint assembly...

Edit:
I do have SharePoint Foundation and SQL Express installed on the dev machine, but I think this shouldn't have something to do with this Problem.

Thanks for your help

br
Christoph

Peter Filipov
Telerik team
 answered on 10 Sep 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?