Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
385 views
I am trying to make the radgrid work using an objectdatasource as the datasource for the radgrid. I saw in different posts that in order for the radgrid to do sorting and updating with objects, the class has to implement the Ienumerable interface. The code for my business object is 

Public

 

Class IngredientSource

 

 

Private _ID As Integer

 

 

Private _CompanyID As String

 

 

Private _CompanyName As String

 

 

Private _AddlCompanyName As String

 

 

Private _EntryDate As DateTime

 

 

Private _Comment As String

 

 

Private _AgencyID As Integer

 

 

Private _AgencyName As String

 

 

Private _RenewalMonth As String

 

 

 

 

Public Property ID() As Integer

 

 

Get

 

 

Return _ID

 

 

End Get

 

 

Set(ByVal value As Integer)

 

_ID = value

 

End Set

 

 

End Property

 

 

Public Property CompanyName() As String

 

 

Get

 

 

Return _CompanyName

 

 

End Get

 

 

Set(ByVal value As String)

 

_CompanyName = value

 

End Set

 

 

End Property

 

 

Public Property AddlCompanyName() As String

 

 

Get

 

 

Return _AddlCompanyName

 

 

End Get

 

 

Set(ByVal value As String)

 

_AddlCompanyName = value

 

End Set

 

 

End Property

 

 

Public Property EntryDate() As DateTime

 

 

Get

 

 

Return _EntryDate

 

 

End Get

 

 

Set(ByVal value As DateTime)

 

_EntryDate = value

 

End Set

 

 

End Property

 

 

Public Property Comment() As String

 

 

Get

 

 

Return _Comment

 

 

End Get

 

 

Set(ByVal value As String)

 

_Comment = value

 

End Set

 

 

End Property

 

 

Public Property AgencyID() As Integer

 

 

Get

 

 

Return _AgencyID

 

 

End Get

 

 

Set(ByVal value As Integer)

 

_AgencyID = value

 

End Set

 

 

End Property

 

 

Public Property AgencyName() As String

 

 

Get

 

 

Return _AgencyName

 

 

End Get

 

 

Set(ByVal value As String)

 

_AgencyName = value

 

End Set

 

 

End Property

 

 

Public Property RenewalMonth() As String

 

 

Get

 

 

Return _RenewalMonth

 

 

End Get

 

 

Set(ByVal value As String)

 

_RenewalMonth = value

 

End Set

 

 

End Property

 

 

Public ReadOnly Property FullName() As String

 

 

Get

 

 

Return Trim(_CompanyName) + ", " + Trim(_AddlCompanyName)

 

 

End Get

 

 

End Property

 

End

 

Class

 

 

Public

 

Class IngredientSourceList

 

 

Inherits List(Of IngredientSource)

 

 

Public Sub New()

 

 

End Sub

 

End

 

Class

How would I implement Ienumerable with this class and does the IngredientSourceList use Ienumberable by using   List(of)

Thank you . I am a newbie at vb.net

Judith

 

Nikolay Rusev
Telerik team
 answered on 09 Jan 2009
2 answers
99 views
Hi,

I have two grids, master and child ones which are Ajax Enabled.  The child grid should refresh on paging/sorting/filtering and should be for the first record of master grid. I am able to refresh the child grid. But if the first record of the master grid does not have any records that needs to be shown in child grid I need to show a label saying "No records displayed" and hide the child grid. I am not able to display the label and also because of this I am getting "Invalid Postback or Callback Argument" error. Please help me in getting rid of this. Any suggestions are highly appreciated. This is also critical for me as I am approaching the deadline. Thanks.
Sebastian
Telerik team
 answered on 09 Jan 2009
1 answer
151 views
Good afternoon :-)

RadTextBox

Is it possible to set the "MaxLength" to the size of SQL 2005 DB field "automagicly" :-)
(RadTextBox, RadMaskedTextBox, RadNumericTextBox...)

Ex.:
CREATE TABLE [dbo].[Locale](
    [idLocale] [nchar](10) NOT NULL,
    [Description] [nvarchar](50) NULL,
 CONSTRAINT [PK_Locale] PRIMARY KEY CLUSTERED

                        <telerik:RadTextBox ID="Description" Text='<%# Bind("Description") %>' Runat="server" Skin="WebBlue" 
                            Width="200px"  ReadOnly="true" MaxLength="50"
                        </telerik:RadTextBox> 
 

I'd like to remove the MaxLength="50" properties or that we don't need to explicitly define it.

Thanks!


Sebastian
Telerik team
 answered on 09 Jan 2009
1 answer
145 views

Hello,

I was wondering if Telerik supports some of the other event attributes like UID, Category, Location, etc. that are in the ICS file specification but not currently coming out of the scheduler.  Is Telerik doing that at all?

 

Also, are you aware if the ICS's UID is stored and used by outlook at all?  I'm trying to research it, but I can't find documentation.  I was wondering if the UID could be used to edit an existing appointment, instead of creating a new one.

 

Thanks.

Peter
Telerik team
 answered on 09 Jan 2009
2 answers
194 views
Hello,

On page 71 on the RadControlsAJAXCourseware.pdf, it introduces the ClientID and ID properties.  I need more understanding on this.  I understand the ID property of a control, but somehow the info on this page is a little confusing to me.  Now, I noticed that this topic must be a challenging one because further down the page, a blog is listed offering more information. I'm reading the blog, but I'm still unclear as it speaks about NamingContainer (which I assume is Namespace) and other info that I'm not quite looking for right now.

To simply ask, could you tell me exactly what this means (bolded text)?
1)

In some cases, "RadMenu1" will be present, but $find("RadMenu1") will return null. A safer way to find your

RadControl is to use a server tag to output the control ClientID to the $find() method. We leave it up to the

RadControl to figure out the correct ClientID in case the control is nested within a master page or user

control and the ClientID wouldn't be what we expect:


2)

ID and ClientID

The

 

ID property of a control identifies an ASP.NET server control. The ID is only unique within

 

the current NamingContainer (page, user control, item template).


3)
The

 

ClientID property is unique within the entire page. The ClientID will be rendered with the

 

container control, an underscore

 

and the control ID. If "RadMenu1" is located directly on the

 

page the two properties would be:


 

ID: "RadMenu1"

 

 

ClientID: "RadMenu1"

 

If "RadMenu1" is located in a user control "WebUserControl1", the properties are:

 

ID: "RadMenu1"

 

 

ClientID: "WebUserControl1_RadMenu1"

 



Thanks,
R2
R2
Top achievements
Rank 1
 answered on 09 Jan 2009
3 answers
100 views
Is there a way to implement a Selected State of the appointment? Like on a single click I would like to change appointment's style. I saw a post about doing it client-side but I want to implement it server-side.
Peter
Telerik team
 answered on 09 Jan 2009
1 answer
148 views
I am wondering whether the RAD Scheduler could be made to work in the scenario below.  The documentation leads me to think that the scheduler is intended primarily to track schedules for one person at a time.  Eg, I can set my schedule up, and you can set yours up, but the two must be viewed separately.

This scenario is for a school which needs to make schedules for students, staff, locations, and groups of the three.

So, for example, the scheduler should drop two students and one staff member into a 45 minute meeting in room A on a given day at 10:45.  On the same day, it should drop different students and staff members into a different room at the same time.  If someone tries to put the same student in different places at overlapping times, it would be rejected.

I cannot tell from skimming the documentation whether this is feasible with the scheduler.  As mentioned above, it looks like a tool for dealing with one individual, not with groups resources.

Thanks
Mike Thomas
Peter
Telerik team
 answered on 09 Jan 2009
3 answers
148 views
Hi,
    How can i get the name of the resource for which the timeslot has been clicked in the OnClientAppointmentInserting event.

My code looks like this:

function

OnClientAppointmentInserting(sender, eventArgs)

 

{

    eventArgs.set_cancel(

true);

 

 

    var x=eventArgs.get_resource(); // not working i need a suitable function here.

 

 

    if(eventArgs.get_startTime().getHours() < 8)

 

    {

        alert(

"non-business hour");

 

    }

 

    else

 

    {
        window.location.href =

"NewBooking.aspx";

 

    }

 

}


i want to store the id of the resource in x and send it through querystring.

Atanas Korchev
Telerik team
 answered on 09 Jan 2009
14 answers
230 views
First off, thanks for all your help - I have never worked with a company with the level of assistance you provide - I am a client for life!

I preface that because I feel guilty that I haven't found the answer to this and am sure it is out there.  I want to use the xml provider to minimize the work to build out a scheduler.  I need to include a color, or custom attribute, much like the example you have on the demos site.  Is there a simple example that you could show me so I can take advantage of the included provider AND add a custom attribute?  It appears that this is possible based on what I read in the docs when comparing it to a custom resource, which would require a custom data source.

I see the example at http://demos.telerik.com/aspnet-ajax/Scheduler/Examples/XmlSchedulerProvider/DefaultCS.aspx. 
Questions:
  1. Would I just remove the ondatabound event and set the provider to the xml file in a real world situation?
  2. Is the xml file changed beyond the default for this the attribute to be stored?  I don't see in the example code anywhere that the attribute is defined.

Maybe this is as simple as changing this example a little.  I might not be asking the correct questions.  I just want to give you some background on what I have looked at so you can answer this one time and I hopefully won't bug you again!
kyle goodfriend
Top achievements
Rank 2
 answered on 09 Jan 2009
2 answers
250 views
I am trying to customize the appointment template in the Monthly view.  When I add an appointment template, it displays nothing.  I tried placing static text in place of the bound objects and it still didn't display anything.  Can somebody take a look an tell me what I am missing?

<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="RentalCalendar.aspx.vb" Inherits="HowToRent" %> 
<%@ Register TagPrefix="UsrContent01" TagName="usrCtlMain" Src="~/ClientPages/Calendar.ascx" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"
<style type="text/css">   
    div.RadScheduler .rsMonthView .rsWrap          
    {          
        height: auto;          
        font-size: 0;        
        min-height: 10px; /* * 4 = empty cell height */  
        line-height:10px;    
    }          
    div.RadScheduler .rsMonthView .rsDateWrap,        
    div.RadScheduler .rsWrap div.rsApt,        
    div.RadScheduler .rsRow div.rsShowMore        
    {          
        position: relative;          
        font:  8px/16px verdana,sans-serif;        
    }    
    </style>  
     
    <UsrContent01:usrCtlMain ID="UsrCtlMain" runat="server" /> 
        <telerik:RadScheduler ID="RadScheduler1" runat="server"  
        CustomAttributeNames="SelectedColor,SelectedColor1,PostEvent" 
        DataEndField="End"  Skin="Web20" 
         OverflowBehavior="Expand" 
          ShowViewTabs="false" 
           SelectedView="MonthView" 
           EnableEmbeddedSkins="True" 
             AllowEdit="false" 
              AllowDelete ="false" 
              AllowInsert="false" 
            DataKeyField="ID" DataRecurrenceField="RecurrenceRule"  
            DataRecurrenceParentKeyField="RecurrenceParentID"  
            DataSourceID="AccessDataSource1" DataStartField="Start"  
            DataSubjectField="Subject" HoursPanelTimeFormat="htt"  
            ValidationGroup="RadScheduler1"
        <AppointmentTemplate>  
            (<asp:Literal ID="AppointmentStartTime" runat="server" Text='<%# Eval("Start", "{0:t}") %>'></asp:Literal>  
            -   
            <asp:Literal ID="AppoitmentEndTime" runat="server" Text='<%# Eval("End", "{0:t}") %>'></asp:Literal>)              
            <asp:Literal ID="AppointmentSubject" runat="server" Text='<%# Eval("Subject") %>'></asp:Literal>  
        </AppointmentTemplate>  
                </telerik:RadScheduler> 
        <asp:AccessDataSource ID="AccessDataSource1" runat="server"  
            DataFile="~/App_Data/scheduler1a.mdb"  
            DeleteCommand="DELETE FROM [Appointments] WHERE [ID] = ?"  
            InsertCommand="INSERT INTO [Appointments] ([Subject], [Start], [End], [RecurrenceRule], [RecurrenceParentID], [RoomID], [TypeID], [ResourceID], [Description], [SelectedColor], [SelectedColor1]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"  
            SelectCommand="SELECT * FROM [Appointments]"  
            UpdateCommand="UPDATE [Appointments] SET [Subject] = ?, [Start] = ?, [End] = ?, [RecurrenceRule] = ?, [RecurrenceParentID] = ?, [RoomID] = ?, [TypeID] = ?, [ResourceID] = ?, [Description] = ?, [SelectedColor] = ?, [SelectedColor1] = ? WHERE [ID] = ?"
            <DeleteParameters> 
                <asp:Parameter Name="ID" Type="Int32" /> 
            </DeleteParameters> 
            <UpdateParameters> 
                <asp:Parameter Name="Subject" Type="String" /> 
                <asp:Parameter Name="Start" Type="DateTime" /> 
                <asp:Parameter Name="End" Type="DateTime" /> 
                <asp:Parameter Name="RecurrenceRule" Type="String" /> 
                <asp:Parameter Name="RecurrenceParentID" Type="Int32" /> 
                <asp:Parameter Name="RoomID" Type="Int32" /> 
                <asp:Parameter Name="TypeID" Type="Int32" /> 
                <asp:Parameter Name="ResourceID" Type="Int32" /> 
                <asp:Parameter Name="Description" Type="String" /> 
                <asp:Parameter Name="SelectedColor" Type="String" /> 
                <asp:Parameter Name="SelectedColor1" Type="String" /> 
                <asp:Parameter Name="ID" Type="Int32" /> 
            </UpdateParameters> 
            <InsertParameters>              
                <asp:Parameter Name="Subject" Type="String" /> 
                <asp:Parameter Name="Start" Type="DateTime" /> 
                <asp:Parameter Name="End" Type="DateTime" /> 
                <asp:Parameter Name="RecurrenceRule" Type="String" /> 
                <asp:Parameter Name="RecurrenceParentID" Type="Int32" /> 
                <asp:Parameter Name="RoomID" Type="Int32" /> 
                <asp:Parameter Name="TypeID" Type="Int32" /> 
                <asp:Parameter Name="ResourceID" Type="Int32" /> 
                <asp:Parameter Name="Description" Type="String" /> 
                <asp:Parameter Name="SelectedColor" Type="String" /> 
                <asp:Parameter Name="SelectedColor1" Type="String" /> 
            </InsertParameters> 
        </asp:AccessDataSource> 
 
</asp:Content> 
 
 
Code Behind
Imports Telerik.Web.UI 
Imports System.Collections.Generic 
 
Partial Class HowToRent 
    Inherits BasePage 
 
    Protected Sub RadScheduler1_AppointmentCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.AppointmentCreatedEventArgs) Handles RadScheduler1.AppointmentCreated 
        'Dim subj As Label = e.Container.FindControl("apptSubj") 
        'subj.Text = e.Appointment.Subject 
    End Sub 
 
    Protected Sub RadScheduler1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadScheduler1.PreRender 
        If RadScheduler1.SelectedView = SchedulerViewType.MonthView Then 
            RadScheduler1.DataBind() 
            Dim maxAppointmentsPerDay As Integer = 2 
            Dim currentDay As DateTime = RadScheduler1.VisibleRangeStart 
            While currentDay < RadScheduler1.VisibleRangeEnd 
                Dim nextDay As DateTime = currentDay.AddDays(1) 
                Dim visibleAppointments As IList(Of Appointment) = RadScheduler1.Appointments.GetAppointmentsInRange(currentDay, nextDay) 
                maxAppointmentsPerDay = Math.Max(maxAppointmentsPerDay, visibleAppointments.Count) 
                currentDay = nextDay 
            End While 
            RadScheduler1.MonthView.VisibleAppointmentsPerDay = maxAppointmentsPerDay 
        End If 
        MyBase.OnPreRender(e) 
 
    End Sub 
End Class 
 





kyle goodfriend
Top achievements
Rank 2
 answered on 09 Jan 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?