Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
119 views
Hi,

My site contains a chunk of javascript that I want to run only when a certain RadTab is selected by the user (i.e. MultiPageView).
This code has to be javascript as it changes images on the page without posting back.
I want this code to only run on a certain Tab to reduce overhead* on the other tabs.
*The code changes up to 15 images dynamically.

My approach to this is as follows:

var multiPage = $find("<%=RadMultiPageAdmin.ClientID %>");
var newPage = multiPage.findPageViewByID("New");

    if (newPage.get_selected())
    {
        //run javascript
    }

 
(The MultiPage is called RadTabStripAdmin, the tab I want is called New)

This solution works perfectly in Chrome, FireFox, Opera etc, but not in IE (only IE 10 tested)
When testing the site locally on an ASP.NET dev server, this code does work in IE10.

When the site is published and deployed to the IIS server, the following error is produced (Only in IE 10):
SCRIPT5007: Unable to get property 'findPageViewByID' of undefined or null reference 

Please help!

Matt.

Nencho
Telerik team
 answered on 09 Oct 2013
3 answers
141 views
Is there some property of a radtextbox that can be retrieved in the codebehind that indicates whether the value has been modified?  for a password field, I need to know if it has been modified, and if it has not been modified, not modify the password store on the back end. 
Konstantin Dikov
Telerik team
 answered on 09 Oct 2013
3 answers
131 views
I'm trying to get a RADScheduler project switched over from using calls directly to a SQL Server database, to working with a WCF service. I took the example provided and modified it to work in our situation. But, I'm getting a webexception:

The remote server returned an error: (415) Cannot process the message because the content type 'application/json; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'.. 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.Net.WebException: The remote server returned an error: (415) Cannot process the message because the content type 'application/json; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'..

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.

Stack Trace:

[WebException: The remote server returned an error: (415) Cannot process the message because the content type 'application/json; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'..] System.Net.WebClient.UploadDataInternal(Uri address, String method, Byte[] data, WebRequest& request) +303 System.Net.WebClient.UploadString(Uri address, String method, String data) +167 System.Net.WebClient.UploadString(String address, String method, String data) +35 Telerik.Web.UI.SchedulerWebServiceClient.LoadResources(WebClient client, ResourcesPopulatingEventArgs args) +348 [Exception: An error occurred while requesting resources from the web service. Server responded with: ] Telerik.Web.UI.SchedulerWebServiceClient.HandleWebException(WebException webEx) +315 Telerik.Web.UI.SchedulerWebServiceClient.LoadResources(WebClient client, ResourcesPopulatingEventArgs args) +387 Telerik.Web.UI.SchedulerWebServiceClient.GetResources() +408 Telerik.Web.UI.RadScheduler.BindResourcesFromWebService() +116 Telerik.Web.UI.RadScheduler.BindResources() +107 Telerik.Web.UI.RadScheduler.PerformSelect() +146 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +30 Telerik.Web.UI.RadScheduler.EnsureDataBound() +93 Telerik.Web.UI.RadScheduler.CreateChildControls(Boolean bindFromDataSource) +122 Telerik.Web.UI.RadScheduler.CreateChildControls() +34 System.Web.UI.Control.EnsureChildControls() +83 System.Web.UI.Control.PreRenderRecursiveInternal() +42 System.Web.UI.Control.PreRenderRecursiveInternal() +168 System.Web.UI.Control.PreRenderRecursiveInternal() +168 System.Web.UI.Control.PreRenderRecursiveInternal() +168 System.Web.UI.Control.PreRenderRecursiveInternal() +168 System.Web.UI.Control.PreRenderRecursiveInternal() +168 System.Web.UI.Control.PreRenderRecursiveInternal() +168 System.Web.UI.Control.PreRenderRecursiveInternal() +168 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +974 

This is my IAppointmentsWCF.vb code:
Imports System.Collections.Generic
Imports System.ServiceModel
Imports System.ServiceModel.Activation
Imports System.Web
Imports Telerik.Web.UI
Imports System.Configuration
Imports System.Data.Common
 
 
<ServiceContract([Namespace]:="MedSpaOnline.com")> _
<AspNetCompatibilityRequirements(RequirementsMode:=AspNetCompatibilityRequirementsMode.Allowed)> _
<ServiceBehavior(IncludeExceptionDetailInFaults:=True)> _
Public Class SchedulerWcfService
 
 
    Private _controller As WebServiceAppointmentController
    Private _provider As AppointmentsProvider
    Private ReadOnly Property Provider() As AppointmentsProvider
        Get
            If _provider Is Nothing Then
                Dim crypto As Encryption.Crypto = New Encryption.Crypto("Suncoast")
                Dim connString = crypto.Decrypt(ConfigurationManager.ConnectionStrings("POS").ConnectionString)
                Dim factory = DbProviderFactories.GetFactory("System.Data.SqlClient")
                _provider = New AppointmentsProvider()
                _provider.ConnectionString = connString
                _provider.DbFactory = factory
                _provider.PersistChanges = True
 
            End If
            Return _provider
        End Get
    End Property
 
    ''' <summary>
    '''  The WebServiceAppointmentController class is used as a facade to the SchedulerProvider.
    ''' </summary>
    Private ReadOnly Property Controller() As WebServiceAppointmentController
        Get
            If _controller Is Nothing Then
                _controller = New WebServiceAppointmentController(Provider)
            End If
 
            Return _controller
        End Get
    End Property
 
    <OperationContract> _
    <WebInvoke(BodyStyle:=WebMessageBodyStyle.Wrapped)> _
    Public Function GetAppointments(schedulerInfo As MySchedulerInfo) As IEnumerable(Of AppointmentData)
        Return Controller.GetAppointments(schedulerInfo)
    End Function
 
    <OperationContract> _
    <WebInvoke(BodyStyle:=WebMessageBodyStyle.Wrapped)> _
    Public Function InsertAppointment(schedulerInfo As MySchedulerInfo, appointmentData As AppointmentData) As IEnumerable(Of AppointmentData)
        Return Controller.InsertAppointment(schedulerInfo, appointmentData)
    End Function
 
    <OperationContract> _
    <WebInvoke(BodyStyle:=WebMessageBodyStyle.Wrapped)> _
    Public Function UpdateAppointment(schedulerInfo As MySchedulerInfo, appointmentData As AppointmentData) As IEnumerable(Of AppointmentData)
        Return Controller.UpdateAppointment(schedulerInfo, appointmentData)
    End Function
 
    <OperationContract> _
    <WebInvoke(BodyStyle:=WebMessageBodyStyle.Wrapped)> _
    Public Function CreateRecurrenceException(schedulerInfo As MySchedulerInfo, recurrenceExceptionData As AppointmentData) As IEnumerable(Of AppointmentData)
        Return Controller.CreateRecurrenceException(schedulerInfo, recurrenceExceptionData)
    End Function
 
    <OperationContract> _
    <WebInvoke(BodyStyle:=WebMessageBodyStyle.Wrapped)> _
    Public Function RemoveRecurrenceExceptions(schedulerInfo As MySchedulerInfo, masterAppointmentData As AppointmentData) As IEnumerable(Of AppointmentData)
        Return Controller.RemoveRecurrenceExceptions(schedulerInfo, masterAppointmentData)
    End Function
 
    <OperationContract> _
    <WebInvoke(BodyStyle:=WebMessageBodyStyle.Wrapped)> _
    Public Function DeleteAppointment(schedulerInfo As MySchedulerInfo, appointmentData As AppointmentData, deleteSeries As Boolean) As IEnumerable(Of AppointmentData)
        Return Controller.DeleteAppointment(schedulerInfo, appointmentData, deleteSeries)
    End Function
 
    <OperationContract> _
    <WebInvoke(BodyStyle:=WebMessageBodyStyle.Wrapped)> _
    Public Function GetResources(schedulerInfo As MySchedulerInfo) As IEnumerable(Of ResourceData)
        Return Controller.GetResources(schedulerInfo)
    End Function
 
End Class

This is my AppointmentsWCF.svc.vb code:
cmd.Connection = conn
            cmd.Parameters.Add(CreateParameter("@StoreID", StoreID))
            cmd.CommandText = "CustomerAppointmentSelect"
            cmd.CommandType = CommandType.StoredProcedure
 
            Using reader As DbDataReader = cmd.ExecuteReader()
                While reader.Read()
                    Dim res As New Resource()
                    res.Type = "customer"
                    res.Key = reader("CustomerID")
                    res.Text = Convert.ToString(reader("CustomerName"))
                    resources.Add(res)
                End While
            End Using
        End Using
 
        Return resources
    End Function
 
    'Private Sub FillClassCustomers(appointment As Appointment, cmd As DbCommand, classId As Object)
    '    For Each customer As Resource In appointment.Resources.GetResourcesByType("customer")
    '        cmd.Parameters.Clear()
    '        cmd.Parameters.Add(CreateParameter("@ClassID", classId))
    '        cmd.Parameters.Add(CreateParameter("@customerID", customer.Key))
 
    '        cmd.CommandText = "INSERT INTO [DbProvider_ClassCustomers] ([ClassID], [customerID]) VALUES (@ClassID, @customerID)"
    '        cmd.ExecuteNonQuery()
    '    Next
    'End Sub
 
    'Private Sub ClearClassCustomers(classId As Object, cmd As DbCommand)
    '    cmd.Parameters.Clear()
    '    cmd.Parameters.Add(CreateParameter("@ClassID", classId))
    '    cmd.CommandText = "DELETE FROM [DbProvider_ClassCustomers] WHERE [ClassID] = @ClassID"
    '    cmd.ExecuteNonQuery()
    'End Sub
 
    Private Sub PopulateAppointmentParameters(cmd As DbCommand, apt As Appointment, ByVal Action As String)
        If Action.Equals("UPDATE") Then
            cmd.Parameters.Add(CreateParameter("@ID", apt.ID))
        End If
 
        cmd.Parameters.Add(CreateParameter("@StoreID", StoreID))
        cmd.Parameters.Add(CreateParameter("@Subject", apt.Subject))
        cmd.Parameters.Add(CreateParameter("@Start", apt.Start))
        cmd.Parameters.Add(CreateParameter("@End", apt.[End]))
 
        Dim customer As Resource = apt.Resources.GetResourceByType("customer")
        Dim customerId As Object = Nothing
        If customer IsNot Nothing Then
            customerId = customer.Key
        End If
        cmd.Parameters.Add(CreateParameter("@CustomerID", customerId))
 
        Dim employee As Resource = apt.Resources.GetResourceByType("employee")
        Dim employeeId As Object = Nothing
        If employee IsNot Nothing Then
            employeeId = employee.Key
        End If
        cmd.Parameters.Add(CreateParameter("@EmployeeID", employeeId))
 
        Dim rrule As String = Nothing
        If apt.RecurrenceRule <> String.Empty Then
            rrule = apt.RecurrenceRule
        End If
        cmd.Parameters.Add(CreateParameter("@RecurrenceRule", rrule))
 
        Dim parentId As Object = Nothing
        If apt.RecurrenceParentID IsNot Nothing Then
            parentId = apt.RecurrenceParentID
        End If
        cmd.Parameters.Add(CreateParameter("@RecurrenceParentId", parentId))
        cmd.Parameters.Add(CreateParameter("@Annotations", ""))
        cmd.Parameters.Add(CreateParameter("@Description", apt.Description))
        cmd.Parameters.Add(CreateParameter("@Reminder", apt.Reminders.ToString()))
    End Sub
End Class
 
Public Class MySchedulerInfo
    Inherits SchedulerInfo
    Public Property StoreID() As String
        Get
            Return _storeid
        End Get
        Set(value As String)
            _storeid = value
        End Set
    End Property
    Private _storeid As Integer
    Public Sub New(baseInfo As ISchedulerInfo, storeid_1 As Integer)
        MyBase.New(baseInfo)
        StoreID = storeid_1
    End Sub
    Public Sub New()
    End Sub
 
    Protected Overrides Sub Finalize()
        MyBase.Finalize()
    End Sub
End Class

This is the Web.config file:
<?xml version="1.0"?>
<configuration>
  <connectionStrings>
    <!--SQL Server-->
    <!--<add name="POSDB" connectionString="4PWt4K/rc1CkfMOmzAtubPLsFJ51KNDs9YW8tXf54735pIwMePgOdWaP2DazZg5zj2NXHYnkQd36dZb1NwQTXRujp0Me64Xc/rzAVWrKuM/b9S5lBMc0f9oz8fBAxICfi8/ge9CHrY2NOwdysmDO9w=="/>-->
    <!--SQL Express-->
    <add name="POS" connectionString="8FkDM4EumAI6nH1h6twN/Gm9lV0cFp1kH22N3nFpqsTn/65a9ISM9mgbdczruCjHumIWrNtrUAsSJ9qdo710eIvP4HvQh62NjTsHcrJgzvc="/>
  </connectionStrings>
 
  <system.web>
    <compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment >
      <!--<serviceActivations>
        <add factory="System.ServiceModel.Activation.WebServiceHostFactory"
             relativeAddress="AppointmentsWCF.svc"
             service="AppointmentsWCF.SchedulerWcfService"/>
      </serviceActivations>-->
    </serviceHostingEnvironment>
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    <!--
        To browse web app root directory during debugging, set the value below to true.
        Set to false before deployment to avoid disclosing web app folder information.
      -->
    <directoryBrowse enabled="false"/>
  </system.webServer>
 
</configuration>

The application with the RADScheduler is as follows.

This is the AppointmentDisplay.ascx code:
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="AppointmentDisplay.ascx.vb" Inherits="Appointments.AppointmentDisplay" %>
 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
 
 
<div>
<%--    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />--%>
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server" ></telerik:RadAjaxManagerProxy>
<%--    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">--%>
        <telerik:RadScheduler  ID="RadScheduler1" runat="server" DataDescriptionField="Description" DataEndField="End" DataKeyField="ID"
            DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentID" DataReminderField="Reminder"  
            DataStartField="Start" DataSubjectField="Subject" GroupBy="Employee" Skin="Forest" StartInsertingInAdvancedForm="True" OnResourcesPopulating="RadScheduler1_ResourcesPopulating"  >
            <ResourceTypes>
                <telerik:ResourceType  ForeignKeyField="EmployeeID" KeyField="EmployeeID" Name="Employee" TextField="EmployeeName" />
                <telerik:ResourceType  ForeignKeyField="CustomerID" KeyField="CustomerID" Name="Customer" TextField="CustomerName" />
            </ResourceTypes>
            <WebServiceSettings Path="http://localhost:3457/AppointmentsWCF.svc" ResourcePopulationMode="ServerSide" />
        </telerik:RadScheduler>
<%--    </telerik:RadAjaxPanel>--%>
     
 <%--       <asp:SqlDataSource ID="DSAppointments" runat="server" ConnectionString="Data Source=192.168.1.10,427;Initial Catalog=POS;Persist Security Info=True;User ID=sa;Password=67Impala" ProviderName="System.Data.SqlClient"
            SelectCommand="AppointmentsSelect" SelectCommandType="StoredProcedure"
            DeleteCommand="AppointmentsDelete" DeleteCommandType="StoredProcedure"
            InsertCommand="AppointmentsInsert" InsertCommandType="StoredProcedure"
            UpdateCommand="AppointmentsUpdate" UpdateCommandType="StoredProcedure">
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="DSEmployees" runat="server" ConnectionString="Data Source=192.168.1.10,427;Initial Catalog=POS;Persist Security Info=True;User ID=sa;Password=67Impala" ProviderName="System.Data.SqlClient"
            SelectCommand="EmployeeAppointmentSelect" SelectCommandType="StoredProcedure" >
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="DSCustomers" runat="server" ConnectionString="Data Source=192.168.1.10,427;Initial Catalog=POS;Persist Security Info=True;User ID=sa;Password=67Impala" ProviderName="System.Data.SqlClient"
            SelectCommand="CustomerAppointmentSelect" SelectCommandType="StoredProcedure" >
        </asp:SqlDataSource>--%>
</div>

This is the codebehind:
Imports Telerik.Web.UI
 
Public Class AppointmentDisplay
    Inherits System.Web.UI.UserControl
 
    Private cnn As String
    Dim sStoreID As String
    Dim tabstrip As RadTabStrip
    Dim tab As RadTab
    Dim StoreID As HiddenField
 
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim crypto As Encryption.Crypto = New Encryption.Crypto("Suncoast")
        cnn = crypto.Decrypt(ConfigurationManager.ConnectionStrings("POS").ConnectionString)
 
        SetStoreID()
        BuildDSAppointments()
        BuildDSEmployees()
        BuildDSCustomers()
        BuildScheduler()
 
    End Sub
 
    Private Sub SetStoreID()
 
        tabstrip = Parent.FindControl("RadTabStrip1")
        tab = tabstrip.SelectedTab
 
        sStoreID = tab.Attributes.Item("StoreID").ToString
 
        StoreID = Parent.FindControl("StoreID")
 
        StoreID.Value = sStoreID
 
    End Sub
    Private Sub BuildScheduler()
 
        'RadScheduler1.ID = "Scheduler" + sStoreID
        'RadScheduler1.DataSourceID = DSAppointments.UniqueID
        'RadScheduler1.ResourceTypes(0).DataSourceID = DSEmployees.UniqueID
        'RadScheduler1.ResourceTypes(1).DataSourceID = DSCustomers.UniqueID
 
    End Sub
    Private Sub BuildDSAppointments()
 
        'With DSAppointments
        '    .ID = "DSAppointments" + sStoreID
        '    .ConnectionString = cnn
        '    .SelectParameters.Clear()
        '    .SelectParameters.Add(New ControlParameter("StoreID", System.TypeCode.Int32, StoreID.UniqueID, "Value"))
 
        '    .DeleteParameters.Clear()
        '    .DeleteParameters.Add(New Parameter("ID", DbType.Int32))
 
        '    .InsertParameters.Clear()
        '    .InsertParameters.Add(New ControlParameter("StoreID", System.TypeCode.Int32, StoreID.UniqueID, "Value"))
        '    .InsertParameters.Add(New Parameter("Subject", DbType.String))
        '    .InsertParameters.Add(New Parameter("Start", DbType.DateTime))
        '    .InsertParameters.Add(New Parameter("End", DbType.DateTime))
        '    .InsertParameters.Add(New Parameter("CustomerID", DbType.Int32))
        '    .InsertParameters.Add(New Parameter("EmployeeID", DbType.Int32))
        '    .InsertParameters.Add(New Parameter("RecurrenceRule", DbType.String))
        '    .InsertParameters.Add(New Parameter("RecurrenceParentID", DbType.Int32))
        '    .InsertParameters.Add(New Parameter("Annotations", DbType.String))
        '    .InsertParameters.Add(New Parameter("Description", DbType.String))
        '    .InsertParameters.Add(New Parameter("Reminder", DbType.String))
 
        '    .UpdateParameters.Clear()
        '    .UpdateParameters.Add(New ControlParameter("StoreID", System.TypeCode.Int32, StoreID.UniqueID, "Value"))
        '    .UpdateParameters.Add(New Parameter("Subject", DbType.String))
        '    .UpdateParameters.Add(New Parameter("Start", DbType.DateTime))
        '    .UpdateParameters.Add(New Parameter("End", DbType.DateTime))
        '    .UpdateParameters.Add(New Parameter("CustomerID", DbType.Int32))
        '    .UpdateParameters.Add(New Parameter("EmployeeID", DbType.Int32))
        '    .UpdateParameters.Add(New Parameter("RecurrenceRule", DbType.String))
        '    .UpdateParameters.Add(New Parameter("RecurrenceParentID", DbType.Int32))
        '    .UpdateParameters.Add(New Parameter("Annotations", DbType.String))
        '    .UpdateParameters.Add(New Parameter("Description", DbType.String))
        '    .UpdateParameters.Add(New Parameter("Reminder", DbType.String))
        '    .UpdateParameters.Add(New Parameter("ID", DbType.Int32))
 
        'End With
 
    End Sub
 
    Private Sub BuildDSEmployees()
 
        'With DSEmployees
        '    .ID = "DSEmployees" + sStoreID
        '    .ConnectionString = cnn
 
        '    .SelectParameters.Clear()
        '    .SelectParameters.Add(New ControlParameter("StoreID", System.TypeCode.Int32, StoreID.UniqueID, "Value"))
 
        'End With
 
    End Sub
 
    Private Sub BuildDSCustomers()
 
        'With DSCustomers
        '    .ID = "DSCustomers" + sStoreID
        '    .ConnectionString = cnn
 
        '    .SelectParameters.Clear()
        '    .SelectParameters.Add(New ControlParameter("StoreID", System.TypeCode.Int32, StoreID.UniqueID, "Value"))
 
        'End With
 
    End Sub
 
    'Protected Sub RadScheduler1_FormCreated(sender As Object, e As SchedulerFormCreatedEventArgs)
    '    If (e.Container.Mode = SchedulerFormMode.AdvancedEdit) OrElse (e.Container.Mode = SchedulerFormMode.AdvancedInsert) Then
    '        'finds the RadComboBox representing the user resource
    '        Dim customerResource As RadComboBox = TryCast(e.Container.FindControl("ResCustomer"), RadComboBox)
    '        'this line of code will subscribe for the the client-side event fired when user selects a new value from the RadComboBox control
    '        customerResource.OnClientSelectedIndexChanging = "OnClientSelectedIndexChanging"
    '    End If
 
    'End Sub
 
    Protected Sub RadScheduler1_ResourcesPopulating(sender As Object, e As ResourcesPopulatingEventArgs)
        Dim info As AppointmentsWCF.MySchedulerInfo = New AppointmentsWCF.MySchedulerInfo
        info.ViewStart = e.SchedulerInfo.ViewStart
        info.ViewEnd = e.SchedulerInfo.ViewEnd
        info.StoreID = sStoreID
    End Sub
End Class


I have been hacking away at this for almost a week and just can't get his to work! Anyone here that can help with this?
Thanks.





Plamen
Telerik team
 answered on 09 Oct 2013
3 answers
44 views
Hello,

I've implemented the RadGrid contextual menu on a RadGrid and it works fine on PC. When I right click on MAC, the menu appears for a brief time but the page postbacks before I can select an Item.

Here is code I've implemented.

Thanks in advance for your help.
Thomas

<telerik:RadGrid ID="radGridDocumentLibrary" runat="server" AutoGenerateColumns="False" CellSpacing="0" GridLines="None" Width="100%"

OnRowDrop="grdPendingDocuments_RowDrop" Skin="docTable" EnableEmbeddedSkins="false" AllowSorting="True" OnSortCommand="radGridDocumentLibrary_SortCommand">

<ClientSettings AllowRowsDragDrop="true">

<Selecting AllowRowSelect="true" />

<ClientEvents OnRowDragStarted="applyCursor" OnRowDropped="removeCursor" OnRowSelected="removeCursor" />

</ClientSettings>

<MasterTableView DataKeyNames="DocumentID" NoMasterRecordsText="Meeting Document Library is Empty - Upload Documents To Add to Your Board Book" ShowHeader="true">

<Columns>

<telerik:GridTemplateColumn HeaderText="Name" ShowSortIcon="true" SortExpression="DocumentName" SortAscImageUrl="../img/uarrow.gif" SortDescImageUrl="../img/darrow.gif">

<ItemStyle CssClass="docCell dragDroppable" />

<ItemTemplate>

<span>

<i class="icon-file"></i>

<asp:Label ID="lblDocumentName" runat="server" Text='<%# Eval("DocumentName") %>' CssClass="docInSection"></asp:Label></span>

</ItemTemplate>

</telerik:GridTemplateColumn>

<telerik:GridTemplateColumn HeaderText="Date" ShowSortIcon="true" SortExpression="SortDate" SortAscImageUrl="../img/uarrow.gif" SortDescImageUrl="../img/darrow.gif">

<HeaderStyle CssClass="rgHeader docDate" />

<ItemStyle CssClass="docCell docCellDate" />

<ItemTemplate>

<asp:Label ID="lblDocDate" runat="server" Text='<%# Convert.ToDateTime(Eval("DocumentDate").ToString()).ToShortDateString() %>' CssClass="docInSection"></asp:Label>

</ItemTemplate>

</telerik:GridTemplateColumn>

</Columns>

</MasterTableView>

<SortingSettings SortedBackColor="Azure" EnableSkinSortStyles="false"></SortingSettings>

<ClientSettings AllowRowsDragDrop="True">

<Selecting AllowRowSelect="true" EnableDragToSelectRows="false"></Selecting>

<ClientEvents OnRowDropping="onRowDroppingDL"></ClientEvents>

<ClientEvents OnRowContextMenu="RowContextMenu"></ClientEvents>

</ClientSettings>

</telerik:RadGrid>

<telerik:RadContextMenu ID="RadMenu1" runat="server" OnItemClick="RadMenu1_ItemClick"

EnableRoundedCorners="true" EnableShadows="true">

<Items>

<telerik:RadMenuItem Text="Replace">

</telerik:RadMenuItem>

<telerik:RadMenuItem Text="Rename">

</telerik:RadMenuItem>

<telerik:RadMenuItem Text="Delete">

</telerik:RadMenuItem>

<telerik:RadMenuItem Text="View">

</telerik:RadMenuItem>

</Items>

</telerik:RadContextMenu>


Milena
Telerik team
 answered on 09 Oct 2013
2 answers
110 views
Hello, I need to write the items checked in combobox text separated by ",".
  Likewise, delete the items I unchecked in the text of combobox

Check A and B --> combobox text =A,B
uncheck B --> combobox text=A

<telerik:RadComboBox ID="combo_empleados" AllowCustomText="true" Filter="Contains"
            
                EnableLoadOnDemand="true"  runat="server" Width="70%">

                <ItemTemplate>
                     <div >
                          <asp:CheckBox ID="chk1" runat="server" checked="false" AutoPostBack="False" Text=""/> <%# DataBinder.Eval(Container, "Text") %>  
                         
                     </div>
                </ItemTemplate>
            
            </telerik:RadComboBox>


Manuel
Top achievements
Rank 1
 answered on 09 Oct 2013
3 answers
63 views
There is a bug in the RadGrid Pager when the page size is set to Integer.MaxValue (I added an "All" options to the page sizes). Instead of displaying "Page 1 of 1" it displays "Page 1 of 0". Some of the GridPagerItem.Paging values are also incorrect. Here is what they contain in the ItemCreated and ItemDataBound events:

Count = 21474483647
CurrentPageIndex = 0
DatasourceCount = 240
FirstIndexInPage = 0
IsFirstPage = True
IsLastPage = False
LastIndexInPage = 239
PageCount = 0
PageSize = 21474483647

This is the code I use to modify the page sizes dropdown list:
Public Sub SetPageSizes(oPagerItem As GridPagerItem, aSizes As String())
    Dim rcbPager As RadComboBox = DirectCast(oPagerItem.FindControl("PageSizeComboBox"), RadComboBox)
    Dim iTotalItems As Integer = oPagerItem.Paging.DataSourceCount
    rcbPager.Items.Clear()
    For Each sSize As String In aSizes
        Dim iSize As Integer = 0
        If sSize.ToUpper() = "ALL" Then
            iSize = Integer.MaxValue
        Else
            If Not Integer.TryParse(sSize, iSize) Then
                Continue For
            ElseIf iTotalItems < iSize Then
                Continue For
            End If
        End If
        Dim oNewItem As New RadComboBoxItem(sSize, iSize.ToString())
        oNewItem.Attributes.Add("ownerTableViewId", oPagerItem.OwnerTableView.ClientID)
        rcbPager.Items.Add(oNewItem)
    Next
    If iTotalItems > 0 Then
        Dim oItem As RadComboBoxItem = rcbPager.FindItemByValue(oPagerItem.OwnerTableView.PageSize.ToString())
        If oItem IsNot Nothing Then
            oItem.Selected = True
        End If
    End If
End Sub

There is another strange thing to in that, if I add the "All" item as the last item to the PageSizeComboBox as above, upon postback the .Text of the item is no longer "All", but the same as the .Value.

There's other strange behavior with the PageSizeComboBox items on postback as well. If I add an item to the end that contains a fairly small value, it gets sorted first instead of last, and the default items that I did not add back (like "20" and "50") still show up in the items list.
Milena
Telerik team
 answered on 09 Oct 2013
2 answers
84 views
Hi,

I'm using a RadWindow in IE9 but when launched the contents of the window appear blank/empty, works fine in Chrome, Firefox etc.

In IE9 the console gives the following error...


SCRIPT5007: Unable to get value of the property 'getElementsByTagName': object is null or undefined 

We are using the following version of the telerik controls: 2012.2.607.40

Any ideas on why it is failing?

Thanks
Bob
Top achievements
Rank 1
 answered on 09 Oct 2013
4 answers
114 views
Hi,
I use the ContextMenu in RadTreeView for add/edit/delete nodes. On inserting and editing nodes, I need some user input, in order to do some other work. Therefore I want to open a RadWindow on clicking a contextmenuitem with value of selected node as parameter.

Could you please suggest me how to handle this scenario.

Thanks in advance,
Harald Breidler
Kate
Telerik team
 answered on 09 Oct 2013
1 answer
176 views
RadListBoxItem item = new RadListBoxItem(storageIDictionary["UserName"].ToString());
            
             item.ImageUrl = storageIDictionary["Image"].ToString();
              Individual_List.Items.Add(item);
the image are of different sizes and i want to restrict the size to be 70px ,70px
Shinu
Top achievements
Rank 2
 answered on 09 Oct 2013
4 answers
523 views
 

 <telerik:GridNumericColumn UniqueName="c31"  HeaderText="Rate" DataField="c31" DataFormatString="{0:C}"  ColumnGroupName="c3"/>
                    <telerik:GridNumericColumn UniqueName="c32" HeaderText="Hours" DataField="c32" DataFormatString="{0:C}" ColumnGroupName="c3">


I have above code in  Rad grid view, when i am double click rows  ,The column's are went to   edit mode,I modify the values ,then click on update alert  "yes", Then i want to update the modified values...i am not getting the "How to access particular  grid numeric column values " in Update_command().
plz help  me ..post the  snippet  .
Mayur
Top achievements
Rank 1
 answered on 09 Oct 2013
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?