Dynamic Resource

4 posts, 0 answers
  1. SSirica
    SSirica avatar
    50 posts
    Member since:
    Jan 2007

    Posted 25 Aug 2010 Link to this post

    I have a scheduler with appointments where the resource is dependant on an aspect of the appointment.  Here is the scenario.  There are work tickets that have been assigned to different groups.  Each group has a sub set of members that it can be assigned to, essentially setting up a situation where the Resource ("Members") is dependant upon the associated action ticket Group ID.  Gettting the data is not the issue, and the "how" off adding a dynamic resource is also not the issue, what I need to know is where to put:
    Dim rt As New Telerik.Web.UI.ResourceType
    rt.DataSource = ds
    rt.Name = "Members"
    rt.ForeignKeyField = "user_id"
    rt.KeyField = "user_id"
    rt.TextField = "user_first"
    rsWorkSch.ResourceTypes.Add(rt)

    So far I've tried: .AppointmentClick, .FormCreating and .FormCreated.  In every instance the drop down is empty. 

    My question is...where do I put the code to add a dynamic resource so the drop down actually contains data?
  2. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 27 Aug 2010 Link to this post

    Hello SSirica,

    You need to put the code in the OnDataBound event so the resources will be added.

    Please let me know if you have more questions.

    All the best,
    Veronica Milcheva
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Craig Finnigan
    Craig Finnigan avatar
    14 posts
    Member since:
    May 2008

    Posted 26 Jan 2011 Link to this post

    Can you provide a example of what gets added to the ondatabound event?
  5. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 31 Jan 2011 Link to this post

    Hi Craig Finnigan,

    Please accept my apologies for misleading you.

    It will be too late to add resources in the OnDataBound event. The most proper is Page_Init. Here's a sample code:

    protected void Page_Init(object sender, EventArgs e)
        {
            ResourceType rt = new ResourceType();
            rt.DataSource = RoomsDataSource;
            rt.Name = "Room";
            rt.ForeignKeyField = "RoomID";
            rt.KeyField = "ID";
            rt.TextField = "RoomName";
            RadScheduler1.ResourceTypes.Add(rt);
        }

    ASPX:
    <telerik:RadScheduler ID="RadScheduler1" runat="server" OnDataBound="RadScheduler1_DataBound"
            DataDescriptionField="Description" DataEndField="End" DataKeyField="ID" DataRecurrenceField="RecurrenceRule"
            DataRecurrenceParentKeyField="RecurrenceParentID" DataReminderField="Reminder"
            DataSourceID="SqlDataSource1" DataStartField="Start" DataSubjectField="Subject"
            EnableDescriptionField="True">
            <Reminders Enabled="True" />
            </ResourceTypes>
        </telerik:RadScheduler>
        <asp:SqlDataSource ID="RoomsDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:TelerikConnectionString %>"
            SelectCommand="SELECT * FROM [Rooms]"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="SELECT * FROM [Appointments]"></asp:SqlDataSource>

    Hope this helps.

    Best wishes,
    Veronica Milcheva
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top