Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
72 views
Hi ,
I want to integrate radeditor with sharepoint 2010 but getting error.
"Load control template file /_controltemplates/TelerikRadEditorText.ascx failed: Could not load file or assembly 'Telerik.Web.UI' or one of its dependencies. The system cannot find the file specified"

Thanks

Stanimir
Telerik team
 answered on 23 Sep 2013
1 answer
57 views
Hi,
Just a little Issue than i am trying to fix with my proyect. The Issue is the next i want to limit the number of simultaneous appointments so that only one appointment is allowed per time I have this code, but the events: RadScheduler1_AppointmentInsert and  RadScheduler1_AppointmentUpdate do not execute when i insert or update an appointment, and i don't know why:

Protected Sub RadScheduler1_FormCreating(sender As Object, e As SchedulerFormCreatingEventArgs) Handles RadScheduler1.FormCreating

        'RadSchedulerRecurrenceEditor1.ResetLayout()

        If (txtContacto.Text = String.Empty) Then
            ScriptManager.RegisterStartupScript(
                 Me,
                 Me.GetType(),
                 "popup",
                 "alert('Debe Ingresar un Contacto');",
                 True)
            e.Cancel = True
        Else

            If e.Mode = SchedulerFormMode.Insert OrElse e.Mode = SchedulerFormMode.Edit Then
                EditedAppointment = e.Appointment
                e.Cancel = True
            End If

            Dim appointmentToEdit = RadScheduler1.PrepareToEdit(e.Appointment, RadScheduler1.EditingRecurringSeries)

            ScriptManager.RegisterStartupScript(Page, [GetType](), "formScript", "Sys.Application.add_load(openForm);", True)
            PopulateEditForm(appointmentToEdit)

        End If

    End Sub

    ''' <summary>
    ''' Funcion setear Actividad en fila AllDay
    ''' </summary>
    ''' <param name="appointment"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Private Function IsAllDayAppointment(appointment As Appointment) As Boolean

        Dim displayStart As DateTime = RadScheduler1.UtcToDisplay(appointment.Start)
        Dim displayEnd As DateTime = RadScheduler1.UtcToDisplay(appointment.[End])
        Return displayStart.CompareTo(displayStart.[Date]) = 0 AndAlso displayEnd.CompareTo(displayEnd.[Date]) = 0 AndAlso displayStart.CompareTo(displayEnd) <> 0

    End Function

    ''' <summary>
    ''' Inicializar Valores en Form Editable
    ''' </summary>
    ''' <param name="editedAppointment"></param>
    ''' <remarks></remarks>
    Private Sub PopulateEditForm(editedAppointment As Appointment)
        Dim appointmentToEdit As Appointment = RadScheduler1.PrepareToEdit(editedAppointment, RadScheduler1.EditingRecurringSeries)
        TxtDescripcion.Text = appointmentToEdit.Subject

        dtpHoraInicio.SelectedDate = RadScheduler1.UtcToDisplay(appointmentToEdit.Start)
        dtpHoraFinal.SelectedDate = RadScheduler1.UtcToDisplay(appointmentToEdit.[End])

        Dim complejidad As Resource = appointmentToEdit.Resources.GetResourceByType("ID_COMPLEJIDAD")
        If complejidad IsNot Nothing Then
            ddlComplejidad.SelectedValue = complejidad.Key.ToString()
        End If

        Dim id_task As Resource = appointmentToEdit.Resources.GetResourceByType("ID_TASK")
        If id_task IsNot Nothing Then
            TxtIdTask.Text = id_task.Key.ToString()
        End If

        RadSchedulerRecurrenceEditor1.StartDate = appointmentToEdit.Start
        RadSchedulerRecurrenceEditor1.EndDate = appointmentToEdit.[End]

        RecurrenceRuleText = appointmentToEdit.RecurrenceRule

    End Sub

    ''' <summary>
    ''' Agregar Actividad a Calendario
    ''' </summary>
    ''' <param name="sender"></param>
    ''' <param name="e"></param>
    ''' <remarks></remarks>
    Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
        If (ValidarFecha()) Then

            If EditedAppointment Is Nothing Then
                ' Insert Appointment
                Dim aptToInsert As Appointment = PopulateBasicAppointmentPropertiesFromForm()
                InsertarRegistro()
                RadScheduler1.InsertAppointment(aptToInsert)

            Else
                If Not RadScheduler1.EditingRecurringSeries AndAlso (EditedAppointmentParent IsNot Nothing OrElse EditedAppointment.RecurrenceState = RecurrenceState.Master) Then
                    ' Create Exception Appointment
                    Dim aptOccurence = EditedAppointment
                    Dim aptException = PopulateBasicAppointmentPropertiesFromForm(RadScheduler1.PrepareToEdit(aptOccurence, RadScheduler1.EditingRecurringSeries))

                    RadScheduler1.UpdateAppointment(aptException)
                Else
                    ' Update Appointment
                    Dim aptOriginal As Appointment = EditedAppointment

                    If RadScheduler1.EditingRecurringSeries AndAlso (aptOriginal.RecurrenceState = RecurrenceState.Occurrence OrElse aptOriginal.RecurrenceState = RecurrenceState.Exception) Then
                        aptOriginal = EditedAppointmentParent
                    End If

                    Dim aptToUpdate As Appointment = PopulateBasicAppointmentPropertiesFromForm(aptOriginal.Clone())
                    ActualizarRegistro(aptToUpdate.ID)
                    RadScheduler1.UpdateAppointment(aptToUpdate, aptOriginal)

                End If
            End If

            EditedAppointmentID = ""
            EditedAppointmentParentID = ""

            RadDock1.Closed = True

        Else

            RadDock1.Closed = False
            RadDock1.Visible = True

        End If

    End Sub

    Private Function PopulateBasicAppointmentPropertiesFromForm() As Appointment
        Return PopulateBasicAppointmentPropertiesFromForm(Nothing)
    End Function

    ''' <summary>
    ''' Setear Valores Necesarios dentro de Actividad en el Calendario
    ''' </summary>
    ''' <param name="apt"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Private Function PopulateBasicAppointmentPropertiesFromForm(apt As Appointment) As Appointment
        If apt Is Nothing Then
            apt = New Appointment()
        End If

        Dim ID_TASK As New Resource("ID_TASK", Integer.Parse(TxtIdTask.Text), TxtIdTask.Text)
        Dim complejidad As New Resource("ID_COMPLEJIDAD", Integer.Parse(ddlComplejidad.SelectedValue), ddlComplejidad.SelectedItem.Text)
        Dim start As DateTime = RadScheduler1.DisplayToUtc(dtpHoraInicio.SelectedDate.Value)
        Dim [end] As DateTime = RadScheduler1.DisplayToUtc(dtpHoraFinal.SelectedDate.Value)

        apt.Subject = TxtDescripcion.Text
        apt.Start = start
        apt.[End] = [end]

        apt.RecurrenceRule = RecurrenceRuleText

        Dim existingComplejidad As Resource = apt.Resources.GetResourceByType("ID_COMPLEJIDAD")
        If existingComplejidad IsNot Nothing Then
            apt.Resources.Remove(existingComplejidad)
        End If
        apt.Resources.Add(complejidad)

        Return apt
    End Function

    Protected Sub RadAjaxManager1_AjaxRequest(sender As Object, e As AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest
        RadScheduler1.Rebind()
    End Sub

    ''' <summary>
    ''' Evento validar si ya existe una actividad en el mismo horario
    ''' </summary>
    ''' <param name="sender"></param>
    ''' <param name="e"></param>
    ''' <remarks></remarks>
    Public Sub RadScheduler1_AppointmentInsert(sender As Object, e As AppointmentInsertEventArgs) Handles RadScheduler1.AppointmentInsert
        If (RadScheduler1.Appointments.GetAppointmentsInRange(e.Appointment.Start, e.Appointment.End).Count > 0) Then
            ScriptManager.RegisterStartupScript(
                 Me,
                 Me.GetType(),
                 "popup",
                 "alert('Ya existe una actividad asignada a esta hora');",
                 True)
            e.Cancel = True

        End If
    End Sub

    ''' <summary>
    ''' Evento validar si ya existe una actividad en el mismo horario
    ''' </summary>
    ''' <param name="sender"></param>
    ''' <param name="e"></param>
    ''' <remarks></remarks>
    Public Sub RadScheduler1_AppointmentUpdate(sender As Object, e As AppointmentUpdateEventArgs) Handles RadScheduler1.AppointmentUpdate
        If (RadScheduler1.Appointments.GetAppointmentsInRange(e.ModifiedAppointment.Start, e.ModifiedAppointment.End)).Count > 0 Then
            For Each apt As Appointment In RadScheduler1.Appointments.GetAppointmentsInRange(e.ModifiedAppointment.Start, e.ModifiedAppointment.End)
                If (apt.ID <> e.Appointment.ID) Then
                    ScriptManager.RegisterStartupScript(
                 Me,
                 Me.GetType(),
                 "popup",
                 "alert('Ya existe una actividad asignada a esta hora');",
                 True)
                    e.Cancel = True
                End If
            Next
        End If
    End Sub
Boyan Dimitrov
Telerik team
 answered on 23 Sep 2013
1 answer
93 views
Hiya,

We have a strange situation here with RadGrid. We are working under very specific instructions on how to display data with this grid that we have to conform to. One of those requirements is that all rows be in edit mode all the time - the user control edit form never closes for any row. (There are only about 2 dozen rows at any given time).

So.. currently when the update/insert button is pressed either:

A. Nothing appears to happen if there is no loading panel associated with the RadAjaxManager.
B. The whole grid (all rows) become locked and the loading panel graphic shows while the update/insert is taking place. 

What I would like to do is 2 fold:

A. As soon as any data on the user control is changed, a "Changes Pending..." label is visible. Thats easy.

B. When the update/insert button is clicked, a "Saving..." label is visible, and when the save is done, that goes away. 

The problem I am finding is that even tho the codebehind on the main ASPX form (in the grid itemcommand method) is able to change the user control's objects, it only does so after the save and not during/before - making it not very dynamic. 

My first thought then is the move the update/insert code out of the radgrid's itemcommand method and in to the user control's codebehind instead, and control a label with a nested ajaxmanager from there. 

I have a feeling I am missing something... so I thought I would post here just to make sure :)

If anyone has any ideas, please share! 

Thanks much!


Dave
Kostadin
Telerik team
 answered on 23 Sep 2013
5 answers
359 views
In our application we have functionality that when user double click on any row of Rad-grid then that row become in editable mode. so now we have requirement that when user double click on a specific column of that row then after coming in editable mode that control must be auto focused.
So i need the value of cell on which it is double clicked to set the focus on that control when that row comes in editable mode. So is there any event of Rad-grid which provides this functionality.

Any suggestion will be helpful.

In my attached image if i double click on row's RateType column then the RateType Drop Down which comes in editable mode must be auto focused.
Konstantin Dikov
Telerik team
 answered on 23 Sep 2013
1 answer
266 views
Hello, I would like to display in RadBinaryImage  the image loaded in RadAsyncUpload. and temporarily stored in App_Data. 
How can I do?
thanks.
Hristo Valyavicharski
Telerik team
 answered on 23 Sep 2013
5 answers
282 views
i am making a page where i need some validation that StartDate should be less than the EndDate and i m using telerik:GridDateTimeColumn. Please tell me hoe can i compare these two values from telerik:GridDateTimeColumn.
its ergent please.....:-/
Can anyone please help me in this regard......
Princy
Top achievements
Rank 2
 answered on 23 Sep 2013
1 answer
59 views
I have a radsceduler bound to a wcf service. I am inserting an appointment from client code as advanced insert form. There how can I get all the resource type names?

Thanks in advance for any help
Henry
Princy
Top achievements
Rank 2
 answered on 23 Sep 2013
1 answer
1.3K+ views

Hello folks,
 I Have problem like these ..In rad-grid  ..i  Have 20 Column above ....I am Put The allow scroll bar is true ..rad grid  increased ..too wide
  I want to give option to user when ever The User click on "Column  " Link Button I want to hide That Column ..showing remaining column as
it is..But here I got some problem ..I  am not aware of how to use column index based on "Click on Column ". These code I am used to get Column
Index but  unfortunately ..I  am not getting the Value ..
protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
   {
       if (e.CommandName == "hideCol")
       {
           // Add the column index to hide to the hiddenColumnIndexes list
           hiddenColumnIndexes.Add(e.Item.ItemIndex);
           SetupShowHideColumns();
       }
 
       
   }

e.Item.ItemIndex ,I  am Getting "-1" value Can help here to Getting The correct Column Index ..Form user  click on  Column ....
The Following Picture Shows .."-" Symbol in Column Text Prefix ..so When user Click On "-" Button ..We Need to Hide that Column ..but here  "I am not Know How get Column Index" raised By Event Column .



 
protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
  {
      // For the header row add a link button to each header
      // cell which can execute a row command
       
      if (e.Item.ItemType==GridItemType.Header)
      {
          // Loop through each cell of the header row
          for (int columnIndex = 0; columnIndex < e.Item.Cells.Count; columnIndex++)
          {
              LinkButton hideLink = new LinkButton();
              hideLink.CommandName = "hideCol";
              hideLink.CommandArgument = columnIndex.ToString();
              hideLink.Text = "-";
              hideLink.CssClass = "gvHideColLink";
              hideLink.Attributes.Add("title", "Hide Column");
 
              // Add the "Hide Column" LinkButton to the header cell
              e.Item.Cells[columnIndex].Controls.AddAt(0, hideLink);
 
              // If there is column header text then
              // add it back to the header cell as a label
              if (e.Item.Cells[columnIndex].Text.Length > 0)
              {
                  Label columnTextLabel = new Label();
                  columnTextLabel.Text = e.Item.Cells[columnIndex].Text;
                  e.Item.Cells[columnIndex].Controls.Add(columnTextLabel);
              }
          }
      }
 
      // Hide the column indexes which have been stored in hiddenColumnIndexes
      foreach (int columnIndex in hiddenColumnIndexes)
          if (columnIndex < e.Item.Cells.Count)
              e.Item.Cells[columnIndex].Visible = false;
  }

The Below to Code to Bind the Data And Hide That Column Code .



Thanks
Reply me Any One.

 


Princy
Top achievements
Rank 2
 answered on 23 Sep 2013
4 answers
720 views

Hello.  I’m trying to use a RadDatePicker and a RadTimePicker to pick a date and time separately and then combine the two into a variable (JavaScript).  The issue I’m having is that when I choose a date from the date popup of the RadDatePicker, it defaults to a time of 12:00am (00:00:00).  And when I choose a time from the time popup of the RadTimePicker, it defaults to the current date.  How can I combine the date and time that I choose without using a RadDateTimePicker?

 

Thank in advance.

Shinu
Top achievements
Rank 2
 answered on 23 Sep 2013
1 answer
105 views
Hi
I am using the sharepoint project using the Telerik control. 
after using this rad control(i.e combo box) I get the following error.

Error 1 The type 'System.Web.UI.IScriptControl' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. D:\..\..\..\VisualWebPart1.ascx.g.cs 40 54

have any idea, how to solve this.


Genady Sergeev
Telerik team
 answered on 23 Sep 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?