Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
231 views
Can anyone give me a sample on how to bind a RadScheduler to a object List of type Telerick.Web.Ui.Appointment?
Here is my VB:

Imports System.IO
Imports Microsoft.VisualBasic
Imports System.Collections.Generic
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Data
Imports System.Configuration
Imports System.Web.Security
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls
Imports Telerik.Web.UI
Imports System.Drawing

Public Class MyAvailability
    Inherits System.Web.UI.Page
    Private Class CustomAppointmentComparer
        Implements IComparer(Of Appointment)
        Public Function Compare(first As Appointment, second As Appointment) As Integer Implements IComparer(Of Telerik.Web.UI.Appointment).Compare
            Dim infoStart1 As String = first.Start.ToString
            Dim infoend1 As String = first.End.ToString
            Dim infoStar2 As String = second.Start.ToString
            Dim infoend2 As String = second.End.ToString
            If first Is Nothing OrElse second Is Nothing Then
                Throw New InvalidOperationException("Can't compare null object(s).")
            End If

            If [String].Compare(first.Subject.ToString, second.Subject.ToString) < 0 Then
                Return -1
            End If

            If [String].Compare(first.Subject.ToString, second.Subject.ToString) > 0 Then
                Return 1
            End If

            Return 0
        End Function
    End Class

    Protected Overrides Sub OnInit(e As EventArgs)
        MyBase.OnInit(e)
        RadScheduler1.Provider = New XmlSchedulerProvider(Server.MapPath("~/App_Data/Appointments.xml"), True)
    End Sub

    Protected Sub RadScheduler1_AppointmentDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.SchedulerEventArgs) Handles RadScheduler1.AppointmentDataBound
        e.Appointment.CssClass = "MyCustomAppointmentStyle"
        If e.Appointment.Subject = "Availability" Then
            e.Appointment.CssClass = "•rsCategoryYellow"
        Else
            e.Appointment.CssClass = "rsCategoryGreen"
        End If
        ''e.Appointment.
    End Sub

    Protected Sub RadScheduler1_AppointmentCreated(sender As Object, e As AppointmentCreatedEventArgs) Handles RadScheduler1.AppointmentCreated
        ''If e.Appointment.Subject = "Prefered Availability" Then
        If e.Appointment.Subject = "Preference" Then

            e.Appointment.BackColor = System.Drawing.Color.Green
        End If
        If e.Appointment.Subject = "Availability" Then

            e.Appointment.BackColor = System.Drawing.Color.FromName("#FEEDA9")
        End If
        If e.Appointment.Visible AndAlso Not IsAppointmentRegisteredForTooltip(e.Appointment) Then
            Dim id As String = e.Appointment.ID.ToString()

            For Each domElementID As String In e.Appointment.DomElements
                RadToolTipManager1.TargetControls.Add(domElementID, id, True)
            Next
        End If
    End Sub

    Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
        RadToolTipManager1.OnClientRequestStart = "OnClientRequestStart"
        RadScheduler1.AppointmentComparer = New CustomAppointmentComparer()
        Dim appointments As Appointment() = RadScheduler1.Appointments.ToArray()
        Array.Sort(appointments, New CustomAppointmentComparer())
        For Each appointment As Appointment In appointments
            Dim appointmentStart As DateTime = RadScheduler1.UtcToDisplay(appointment.Start)
            If appointmentStart > RadScheduler1.SelectedDate Then
                RadScheduler1.SelectedDate = appointmentStart.[Date]
                Exit For
            End If
        Next
    End Sub

    Protected Sub RadScheduler1_DataBound(ByVal sender As Object, ByVal e As EventArgs) Handles RadScheduler1.DataBound
        RadToolTipManager1.TargetControls.Clear()
        ScriptManager.RegisterStartupScript(Me, GetType(System.Web.UI.Page), "HideToolTip", "hideActiveToolTip();", True)
        Dim monthNum As Integer = RadScheduler1.VisibleRangeStart.Month
        Dim strDate As New DateTime(1, monthNum, 1)           
        RadScheduler1.Localization.AllDay = strDate.ToString("MMMMM")
    End Sub

    Protected Sub MyAvailability1_FormCreated(ByVal sender As Object, ByVal e As SchedulerFormCreatedEventArgs) Handles RadScheduler1.FormCreated
        If (e.Container.Mode = SchedulerFormMode.AdvancedEdit) OrElse (e.Container.Mode = SchedulerFormMode.AdvancedInsert) Then
            Dim allDayCheckbox As CheckBox = DirectCast(e.Container.FindControl("AllDayEvent"), CheckBox)
            allDayCheckbox.Style.Add("visibility", "hidden")
            Dim attrAnnotationsTextbox As RadTextBox = DirectCast(e.Container.FindControl("Subject"), RadTextBox)
            attrAnnotationsTextbox.Label = "Type"
            attrAnnotationsTextbox.Enabled = False
            Dim AppointmentID As Integer = e.Appointment.ID
            Dim AppointmentIDPrevious As Integer = e.Appointment.ID - 1
            Dim PreviousAppointment As New Appointment

            ''Dim startPicker As RadTimePicker = DirectCast(e.Container.FindControl("StartTime"), RadTimePicker)
            ''startPicker.TimeView.StartTime = TimeSpan.FromHours(1.5)
            ''startPicker.TimeView.EndTime = TimeSpan.FromHours(24)
            ''startPicker.TimeView.DataList.DataSource = Nothing
            ''startPicker.TimeView.DataBind()

            ''Dim endPicker As RadTimePicker = DirectCast(e.Container.FindControl("EndTime"), RadTimePicker)
            ''endPicker.TimeView.StartTime = TimeSpan.FromHours(8)
            ''endPicker.TimeView.EndTime = TimeSpan.FromHours(24)
            ''endPicker.TimeView.DataList.DataSource = Nothing
            ''endPicker.TimeView.DataBind()

            '' Dim StartTimeAppointmentIDPrevious As String = RadScheduler1.Appointments.FindByID(52).Start.ToString
            '' Catch ex As Exception
            ''ex.ToString()
            '' End Try
            Dim scheduler As RadScheduler = DirectCast(sender, RadScheduler)
            Dim StartTimeAvail As DateTime
            Dim EndTimeAvail As DateTime
            If e.Appointment.Subject = "Preference" Then

                For Each app As Appointment In scheduler.Appointments.GetAppointmentsInRange(e.Appointment.Start, e.Appointment.[End])

                    If app.Subject = "Availability" Then
                        StartTimeAvail = app.Start.ToShortTimeString
                        EndTimeAvail = app.End.ToShortTimeString
                        Exit For
                    End If

                Next

            End If
            Dim startPicker As RadTimePicker = DirectCast(e.Container.FindControl("StartTime"), RadTimePicker)
            Dim endPicker As RadTimePicker = DirectCast(e.Container.FindControl("EndTime"), RadTimePicker)
            Dim StartDbleTime As Double = StartTimeAvail.ToOADate() * 24
            Dim EndDbleTime As Double = EndTimeAvail.ToOADate() * 24 + 0.5
            startPicker.TimeView.StartTime = TimeSpan.FromHours(StartDbleTime)
            ''startPicker.TimeView.EndTime = TimeSpan.FromHours(24)
            startPicker.TimeView.EndTime = TimeSpan.FromHours(EndDbleTime)
            endPicker.TimeView.StartTime = TimeSpan.FromHours(StartDbleTime)
            endPicker.TimeView.EndTime = TimeSpan.FromHours(EndDbleTime)

            startPicker.TimeView.DataList.DataSource = Nothing
            startPicker.TimeView.DataBind()
            endPicker.TimeView.DataList.DataSource = Nothing
            endPicker.TimeView.DataBind()
            ''Dim startTime As RadTimePicker = TryCast(e.Container.FindControl("StartTime"), RadTimePicker)
            ''Dim DbleTime As Double = ADate.ToOADate() * 24
            ''startPicker.TimeView.StartTime = TimeSpan.FromHours(DbleTime)
        End If
    End Sub

    Protected Sub MyAvailability1_AppointmentInsert(sender As Object, e As AppointmentInsertEventArgs) Handles RadScheduler1.AppointmentInsert
        If e.Appointment.Subject = "Preference" Then
            Dim scheduler As RadScheduler = DirectCast(sender, RadScheduler)
            For Each app As Appointment In scheduler.Appointments.GetAppointmentsInRange(e.Appointment.Start, e.Appointment.[End])
                If app.Subject = "Availability" Then
                    If app.Start > e.Appointment.Start OrElse app.[End] <= e.Appointment.[End] Then
                        e.Cancel = True
                    End If
                End If

            Next
        End If

    End Sub
    Protected Sub MyAvailability1_AppointmentUpdate(sender As Object, e As AppointmentUpdateEventArgs) Handles RadScheduler1.AppointmentUpdate
        Dim scheduler As RadScheduler = DirectCast(sender, RadScheduler)
        If e.ModifiedAppointment.Subject = "Preference" Then
            For Each app As Appointment In scheduler.Appointments.GetAppointmentsInRange(e.ModifiedAppointment.Start, e.ModifiedAppointment.[End])

                If app.Subject = "Availability" Then
                    If app.Start > e.ModifiedAppointment.Start OrElse app.[End] < e.ModifiedAppointment.[End] Then
                        e.Cancel = True
                    End If
                End If

            Next
        End If

        If e.ModifiedAppointment.Subject = "Availability" Then
            For Each app As Appointment In scheduler.Appointments.GetAppointmentsInRange(e.ModifiedAppointment.Start, e.ModifiedAppointment.[End])

                If app.Subject = "Preference" Then
                    If app.Start < e.ModifiedAppointment.Start OrElse app.[End] > e.ModifiedAppointment.[End] Then
                        e.Cancel = True
                    End If
                End If
            Next
        End If

    End Sub

    Private Function IsAppointmentRegisteredForTooltip(ByVal apt As Appointment) As Boolean
        For Each targetControl As ToolTipTargetControl In RadToolTipManager1.TargetControls
            If (apt.DomElements.Contains(targetControl.TargetControlID)) Then
                Return True
            End If
        Next
        Return False
    End Function

    Protected Sub RadToolTipManager1_AjaxUpdate(ByVal sender As Object, ByVal e As ToolTipUpdateEventArgs)
        Dim aptId As Integer
        Dim apt As Appointment
        If Not Integer.TryParse(e.Value, aptId) Then
            'The appoitnment is occurrence and FindByID expects a string
            apt = RadScheduler1.Appointments.FindByID(e.Value)
        Else
            'The appointment is not occurrence and FindByID expects an int
            apt = RadScheduler1.Appointments.FindByID(aptId)
        End If
        ''Dim toolTip As AppointmentToolTip = CType(LoadControl("AppointmentToolTip.ascx"), AppointmentToolTip)
        ''toolTip.TargetAppointment = apt
        ''e.UpdatePanel.ContentTemplateContainer.Controls.Add(toolTip)
    End Sub

    Public newStartLabel As String = ""
    Public newEndLabel As String = ""
    Public dayOfWeek As String = ""
    Protected Sub RadScheduler1_AppointmentUpdate(sender As Object, e As AppointmentUpdateEventArgs)
        If e.ModifiedAppointment.Subject = "Availability" Then
            newStartLabel = e.ModifiedAppointment.Start.ToString()
            newEndLabel = e.ModifiedAppointment.[End].ToString()
            dayOfWeek = e.ModifiedAppointment.Start.DayOfWeek.ToString()
        End If
    End Sub

    Protected Sub RadScheduler1_TimeSlotCreated(sender As Object, e As TimeSlotCreatedEventArgs) Handles RadScheduler1.TimeSlotCreated
        Dim scheduler As RadScheduler = DirectCast(sender, RadScheduler)
        ''If scheduler.SelectedView = SchedulerViewType.WeekView AndAlso e.TimeSlot.Duration = TimeSpan.FromDays(1) Then

        If e.TimeSlot.Duration = TimeSpan.FromDays(1) Then
            Dim startLabel As New Label()
            Dim startLabelPref As New Label()
            startLabel.ID = "startLabel" + e.TimeSlot.Start.DayOfWeek.ToString + CType(e.TimeSlot.Start.Day, String)
            startLabelPref.ID = "startLabelPref" + e.TimeSlot.Start.DayOfWeek.ToString + CType(e.TimeSlot.Start.Day, String)
            startLabel.Font.Size = 7
            startLabel.Font.Bold = True
            startLabelPref.Font.Size = 7
            startLabelPref.Font.Bold = True

            If newStartLabel <> "" AndAlso dayOfWeek = e.TimeSlot.Start.DayOfWeek.ToString() Then
                startLabel.Text = newStartLabel
            Else
                For Each app As Appointment In RadScheduler1.Appointments.GetAppointmentsInRange(e.TimeSlot.Start, e.TimeSlot.[End])
                    If app.Subject = "Availability" Then
                        Dim TimeFormat As String
                        TimeFormat = Trim(app.Start.ToShortTimeString)
                        ''TimeFormat.Replace(" AM", "a")
                        If TimeFormat.Contains("AM") Then
                            startLabel.Text = "   " + TimeFormat.Replace(" AM", "a")
                        Else
                            startLabel.Text = "   " + app.Start.ToShortTimeString.Replace(" PM", "p")
                        End If
                        startLabel.BackColor = System.Drawing.Color.FromName("#FEEDA9")

                    End If

                    If app.Subject = "Preference" Then
                        Dim TimeFormat As String
                        TimeFormat = Trim(app.Start.ToShortTimeString)
                        ''TimeFormat.Replace(" AM", "a")
                        If TimeFormat.Contains("AM") Then
                            startLabelPref.Text = TimeFormat.Replace(" AM", "a")
                        Else
                            startLabelPref.Text = app.Start.ToShortTimeString.Replace(" PM", "p")
                        End If

                        startLabelPref.BackColor = System.Drawing.Color.FromName("#D0ECBB")
                    End If
                Next
            End If
            Dim endLabel As New Label()
            Dim endLabelPref As New Label()
            ''startLabel.ID = "endLabel" + e.TimeSlot.Start.DayOfWeek.ToString
            endLabel.ID = "endLabel" + e.TimeSlot.End.DayOfWeek.ToString + CType(e.TimeSlot.End.Day, String)
            ''startLabelPref.ID = "endLabelPref" + e.TimeSlot.Start.DayOfWeek.ToString
            endLabelPref.ID = "endLabelPref" + e.TimeSlot.End.DayOfWeek.ToString + CType(e.TimeSlot.End.Day, String)
            endLabel.Font.Size = 7
            endLabel.Font.Bold = True
            endLabelPref.Font.Size = 7
            endLabelPref.Font.Bold = True
            ''If newStartLabel <> "" AndAlso dayOfWeek = e.TimeSlot.Start.DayOfWeek.ToString() Then
            If newEndLabel <> "" AndAlso dayOfWeek = e.TimeSlot.End.DayOfWeek.ToString() Then
                endLabel.Text = "-" + newEndLabel
            Else
                For Each app As Appointment In RadScheduler1.Appointments.GetAppointmentsInRange(e.TimeSlot.Start, e.TimeSlot.[End])
                    If app.Subject = "Availability" Then
                        Dim TimeFormat2 As String
                        TimeFormat2 = Trim("-" + app.[End].ToShortTimeString)
                        endLabel.Text = TimeFormat2.Replace(" AM", "a")
                        endLabel.Text = "-" + app.[End].ToShortTimeString.Replace(" PM", "p")
                        endLabel.BackColor = System.Drawing.Color.FromName("#FEEDA9")
                    End If

                    If app.Subject = "Preference" Then
                        Dim TimeFormat2 As String
                        TimeFormat2 = Trim("-" + app.[End].ToShortTimeString)
                        endLabelPref.Text = TimeFormat2.Replace(" AM", "a")
                        endLabelPref.Text = "-" + app.[End].ToShortTimeString.Replace(" PM", "p")
                        endLabelPref.BackColor = System.Drawing.Color.FromName("#D0ECBB")
                    End If
                Next
            End If
            Dim divisionLabel As New Label()
            divisionLabel.Text = " | "
            divisionLabel.BackColor = Color.Transparent
            e.TimeSlot.Control.Controls.Add(startLabel)
            e.TimeSlot.Control.Controls.Add(endLabel)
            e.TimeSlot.Control.Controls.Add(divisionLabel)
            e.TimeSlot.Control.Controls.Add(startLabelPref)
            e.TimeSlot.Control.Controls.Add(endLabelPref)
            ''e.Appointment.Attributes.Add("onclick", "javascript:ViewLeave('" & DataRowView.Item("LeaveID").ToString() & "');")
            startLabel.Attributes.Add("onclick", "TimeRangeOnclick")
        End If
        ''End If
    End Sub

    Protected Sub DropDownList1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DropDownList1.SelectedIndexChanged
        Dim ScheduleOption As String = DropDownList1.SelectedItem.ToString
        Dim Msgtext0 As String = ""
        Dim Msgtext1 As String = ""
        Dim Msgtext2 As String = ""
        Select Case ScheduleOption
            Case "Full Time 30 to 40 hours"
                Msgtext0 = "Max number of weekday mornings off is 1"
                Msgtext1 = "Max number of weekday evenings off is 1"
                Msgtext2 = "Max number of days off per week is 2"
                BulletedList1.Items(0).Text = Msgtext0
                BulletedList1.Items(1).Text = Msgtext1
                BulletedList1.Items(2).Text = Msgtext2
            Case "Part Time 15 to 25 hours"
                Msgtext0 = "Max number of weekday mornings off is 3"
                Msgtext1 = "Max number of weekday evenings off is 2"
                Msgtext2 = "Max number of days off per week is 4"
                BulletedList1.Items(0).Text = Msgtext0
                BulletedList1.Items(1).Text = Msgtext1
                BulletedList1.Items(2).Text = Msgtext2

        End Select
       
    End Sub

  
End Class

________________________________________________
My xml file:
<?xml version="1.0" encoding="utf-8"?>
<Appointments>
  <NextID>69</NextID>
  <Appointment>
    <ID>52</ID>
    <Subject>Preference</Subject>
    <Start>2012-06-10T11:00Z</Start>
    <End>2012-06-10T17:00Z</End>
  </Appointment>
  <Appointment>
    <ID>53</ID>
    <Subject>Preference</Subject>
    <Start>2012-06-11T09:30Z</Start>
    <End>2012-06-11T18:00Z</End>
  </Appointment>
  <Appointment>
    <ID>54</ID>
    <Subject>Preference</Subject>
    <Start>2012-06-12T13:30Z</Start>
    <End>2012-06-12T18:30Z</End>
  </Appointment>
  <Appointment>
    <ID>55</ID>
    <Subject>Preference</Subject>
    <Start>2012-06-13T09:30Z</Start>
    <End>2012-06-13T13:00Z</End>
  </Appointment>
  <Appointment>
    <ID>56</ID>
    <Subject>Preference</Subject>
    <Start>2012-06-14T15:00Z</Start>
    <End>2012-06-14T21:30Z</End>
  </Appointment>
  <Appointment>
    <ID>57</ID>
    <Subject>Preference</Subject>
    <Start>2012-06-15T09:00Z</Start>
    <End>2012-06-15T13:00Z</End>
  </Appointment>
  <Appointment>
    <ID>58</ID>
    <Subject>Availability</Subject>
    <Start>2012-06-10T10:30Z</Start>
    <End>2012-06-10T21:00Z</End>
    <TimeZoneID>UTC</TimeZoneID>
  </Appointment>
  <Appointment>
    <ID>59</ID>
    <Subject>Availability</Subject>
    <Start>2012-06-11T09:30Z</Start>
    <End>2012-06-11T18:00Z</End>
    <TimeZoneID>UTC</TimeZoneID>
  </Appointment>
  <Appointment>
    <ID>60</ID>
    <Subject>Availability</Subject>
    <Start>2012-06-12T09:00Z</Start>
    <End>2012-06-12T19:00Z</End>
  </Appointment>
  <Appointment>
    <ID>61</ID>
    <Subject>Availability</Subject>
    <Start>2012-06-13T08:30Z</Start>
    <End>2012-06-13T18:30Z</End>
  </Appointment>
  <Appointment>
    <ID>62</ID>
    <Subject>Availability</Subject>
    <Start>2012-06-14T13:00Z</Start>
    <End>2012-06-14T22:30Z</End>
  </Appointment>
  <Appointment>
    <ID>63</ID>
    <Subject>Availability</Subject>
    <Start>2012-06-15T08:30Z</Start>
    <End>2012-06-15T16:00Z</End>
    <TimeZoneID>UTC</TimeZoneID>
  </Appointment>
  <Appointment>
    <ID>64</ID>
    <Subject>Availability</Subject>
    <Start>2012-06-16T11:00Z</Start>
    <End>2012-06-16T23:30Z</End>
  </Appointment>
  <Appointment>
    <ID>65</ID>
    <Subject>Preference</Subject>
    <Start>2012-06-16T13:30Z</Start>
    <End>2012-06-16T19:30Z</End>
  </Appointment>
</Appointments>

Plamen
Telerik team
 answered on 20 Jul 2012
2 answers
101 views
How can I restrict the access and the manipulation (add, edit, delete) of a TreeList with my membership provider based on roles?
Is this posible or how what can I do?
Thanks in advanced
Andrey
Telerik team
 answered on 20 Jul 2012
1 answer
406 views
On click of ContactUs i am calling OpenVideoContactForm(this) 

<script type="text/javascript">
function OpenVideoContactForm() 
{
var oWnd = radopen('/_layouts/ContactUsPopupBranding/ContactUs.aspx','miniRadWindow');
oWnd.setSize(500,550);
} 
</.script>


<td class="globalLogin" onclick="OpenVideoContactForm();">Contact us</td>

The form is opening fine 
but
on mouse click outside the form i should close the form.

Can anyone tell me how to achieve this?



Princy
Top achievements
Rank 2
 answered on 20 Jul 2012
7 answers
143 views

Hi Guys,

I have some problems of IE's Autocomplete suggestions.
The  IE's Autocomplete suggestions show in wrong position in child window when use RadWindow

Condition...
- The parent page have scroll

- When I open the RadWindow as an overlay and keep the position of overlay not go to top of parent's page the IE Autocomplete suggestions show wrong position. But if I move the overlay to the top of page by scroll up the IE autocomplete is shown the correct position.

How can I solve this problem?

Thanks in advance,
-Toi

Rumen
Telerik team
 answered on 20 Jul 2012
6 answers
747 views
I have a column with Visible=False. It doesn't show in InPlace edit more, but will show in EditForm and PopUp edit mode. How can I hide it in all edit modes?
Chillax
Top achievements
Rank 1
 answered on 20 Jul 2012
3 answers
121 views
Hello,

Currently I'm facing a small problem with the RadInputManager. Somehow when I call clientside an onSubmit on the RadInputManager my inputsettings are not validated / are not triggered. I'm still unable to find the problem what is causing this. Maybe there is a slight chance that you can provide me with an answer?

Environment: Visual Studio 2010
.NET Framework: 3.5
Version: 2012.1.411.35

Declaration of the radinputmanager:

<telerik:RadInputManager ID="InputManager" runat="server" EnableEmbeddedScripts="false" EnableEmbeddedBaseStylesheet="false" EnableEmbeddedSkins="false" RegisterWithScriptManager="false">
    <telerik:RegExpTextBoxSetting Validation-IsRequired="false" InitializeOnClient="true" ValidationExpression="^[0-9]+$"> 
    </telerik:RegExpTextBoxSetting>
    <telerik:TextBoxSetting Validation-IsRequired="true" InitializeOnClient="true">
    </telerik:TextBoxSetting>
    <telerik:TextBoxSetting Validation-IsRequired="true" InitializeOnClient="true">
         <Validation IsRequired="true" ValidateOnEvent="All"/>
    </telerik:TextBoxSetting>
    <telerik:TextBoxSetting Validation-IsRequired="true" InitializeOnClient="true">
         <Validation IsRequired="true" ValidateOnEvent="All"/>
    </telerik:TextBoxSetting>
</telerik:RadInputManager>

Declaration in javascript:
    // Validates the object data
    // @return void
    this.validate = function () {
        var result = true;

        // Get the input manager
        var inputManager = $find("<%=InputManager.ClientID%>");

        // Do already a submit to make sure that all validations are triggered
        inputManager._onSubmit();

        // Get the current settings of the input manager
        var settings = inputManager._getSettings();

        // Start validating all settings
        for (var setting in settings) {
            if (!this.validateInputField($find(setting))) {
                result = false;
                break;
            }
        }

        return result;
    };

    // Validates a input field
    // @param setting: The setting to validate
    // @return bool: True when the setting was valided successfully
    this.validateInputField = function (setting) {
        var result = true;

        for (var input in setting._inputs) {
            result = !setting._inputs[input]._invalid;

            if (!result) {
                break;
            }
        }

        return result;
    };

What am I doing wrong? :)
Michiel
Top achievements
Rank 1
 answered on 20 Jul 2012
6 answers
220 views
Hi I need a hand in setting up a timeline view.
Basically what I need is a full week displayed, at hourly intervals.  I have this setup correctly and is displaying fine, but what I want to do is limit the slots for each day, to display from 8am to 6pm for each day.  If I put in starttime as 8:00 then the first day starts at 8:00, but day 2 starts at 00:00.

I have attached a screen shot of what I mean, can someone guide me on this.
Many thanks


Ivana
Telerik team
 answered on 20 Jul 2012
5 answers
220 views
I have a RadTreeView which is defined thus:

<telerik:RadTreeView ID="radTreeView" runat="server" Width="100%" EnableDragAndDrop="true" EnableDragAndDropBetweenNodes="true"

OnNodeClick="radTreeView_OnNodeClick" OnClientNodeCollapsing="OnClientNodeCollapsing"

OnNodeDrop="radTreeView_OnNodeDrop">

 

<WebServiceSettings Path="BuildTrgMP.aspx" Method="GetChildNodes" />

 

</telerik:RadTreeView>

I have a web service method which populates the tree when nodes are clicked.
The page in question accepts an id in the query string and the id represents the Value of a node in the tree which can be any node in the tree.
The idea is that when the page starts, the user is placed in the tree with the tree expanded and the node with the parameter id selected.
The problem is that there seems to be a conflict between nodes loaded client side by the webservice and nodes loaded server side in page load ie doing expands and searches for nodes server side doesn't find anything because they haven't been loaded client side.
If I code to populate the heirarchy server side in Page_Load, when the page appears, no nodes are expanded, although if I expand them, I come to my selected node. It almost as if having webservice loading conflicts with server side loading.

So to get back to the requirements:
- I have a tree which loads branches using the webservice 
- When the page loads, in Page_Load I want to be able to set a currently selected node (which can be anywhere in the tree and at any level) and I want the tree hierarchy to it to be expanded (all other paths can be collapsed)

How do I do it please ?

Thanks + regards

Graham Plowman

Plamen
Telerik team
 answered on 20 Jul 2012
3 answers
163 views
Hi
I am currently using the scheduler to display a list of users and their weekly activities, this works fine, however, ideally I would like to set a start and end time for each day ie. from 07:00 to 19:00 for each day of the week, if I set a start time of 07:00 it appears for the first day only.
Is it possible to achieve this?

Thanks for your help.

Karl.
Ivana
Telerik team
 answered on 20 Jul 2012
3 answers
124 views
I am having issue with mouse over image when using Office2007 skin.

Height of the image is not proper as height of the item.

Please find attached screenshot for the same.
Kate
Telerik team
 answered on 20 Jul 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
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
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
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
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?