Noob trying to find my way

12 posts, 0 answers
  1. Matt
    Matt avatar
    29 posts
    Member since:
    Oct 2011

    Posted 31 Oct 2011 Link to this post

    Hi, I'm trying to implement the Rad Scheduler control for an application I'm writing and I've had an odd issue I don't understand.

    I'm trying to bind to a list of objects (c# & asp.Net 4.0) and I started getting the error:

    DataKeyField, DataSubjectField, DataStartField and DataEndField are required for databinding


    So I think I fixed that by assigning values to the listed requirements. Then I started having trouble with my datasource and have now remarked out the entire section that binds the control to deal with that separately.

    Now, even with no binding happening, I still get this error. This didn't seem to happen at first - I was getting a blank schedule before if I didn't bind so I'm not sure why I get this error now. It also happens before any of my code on that particular page executes.

    Any ideas to get me back on track? Thanks!
  2. Matt
    Matt avatar
    29 posts
    Member since:
    Oct 2011

    Posted 31 Oct 2011 Link to this post

    Ok, I have made a little progress, but I'm still seeing this error before my databinding code even executes.
    I have the following in a Load event of a page:

            IEnumerable<ObjectTemplate> MyList = ot.GetList();

            RadScheduler1.DataSource = MyList;
            RadScheduler1.DataKeyField = "booking_id";
            RadScheduler1.DataStartField = "Start_Time";
            RadScheduler1.DataEndField = "End_Time";
            RadScheduler1.DataSubjectField = "lsndescrip";

            RadScheduler1.DataBind();

    I have a breakpoint on the RadScheduler1.DataSource line but I never hit it. Before that code is reached I get the following:

    DataKeyField, DataSubjectField, DataStartField and DataEndField are required for databinding


    So do I need to specify these in the markup instead? Or got any other hints? Thanks!

    Matt
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Matt
    Matt avatar
    29 posts
    Member since:
    Oct 2011

    Posted 31 Oct 2011 Link to this post

    Well I made it through my last issue by specifying the DataKeyField, DataStartField, DataEndField, and DataSubjectField in the markup.

    Now, when I bind to my object, I get an error that what I specified in markup as the DataKeyField cannot be found in my object. But I can see it's there when I'm drilling down in the debugger (see attached screen capture).

    Can I even do something like this? I thoguht from what I read I could, but obviously it's not working for me. I'm hoping I'm close. Can anyone here tell? Thanks!

    Matt
  5. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 31 Oct 2011 Link to this post

    Matt,

    I'm taking a flier here, but the casing you use in the markup doesn't match the casing in the screenshot.

    I could be completely wrong about this but...

    -- 
    Stuart
  6. Matt
    Matt avatar
    29 posts
    Member since:
    Oct 2011

    Posted 01 Nov 2011 Link to this post

    Thanks for the suggestion. I see what you are saying for the field names other than booking_id and have corrected those, but I still get the error for booking_id.

    I think for now I'm just going to build a DataTable on the fly to just get this working, but I'd still love to be able to figure out how to bind directly to our data objects instead if there are any other suggestions.

    Matt

    Edit: while not very elegant, this worked. It will have to do for now!
  7. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 02 Nov 2011 Link to this post

    Matt, FWIW, binding to Data Objects does work; we do it.

    We get our data back as objects via WCF and bind it with no problem.

    Can you generate a standalone project showing the problem?

    I've asked 'cos that's what the boys and girls at telerik towers will ask you to do and, I have found, that trying to generate such a project will help you identify the real cause of the problem.

    -- 
    Stuart
  8. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 03 Nov 2011 Link to this post

    Hello,

    @Matt, you can download a standalone sample with various data sources, including ObjectDataSource from this code library link and use it as reference.

    @Stuart, thank you for looking into this case.

    I hope this helps.

    Kind regards,
    Peter
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  9. Matt
    Matt avatar
    29 posts
    Member since:
    Oct 2011

    Posted 03 Nov 2011 Link to this post

    Thanks for the replies. I think my problem was that the object are new .Net 4.0 dynamic objects. I bet I can make it work by casting to a more traditional object with static properties. I'm going to try and get something like that going today.

    PS - downloaded the samples, but they don't build. Is there something specific I need to do to make them build & run?

    Thanks!
  10. Matt
    Matt avatar
    29 posts
    Member since:
    Oct 2011

    Posted 04 Nov 2011 Link to this post

    Thanks, I think that object provider example is pretty similar to what I need to do. But there are a few things that aren't clear to me in this.

    How/where does a custom provider need to be specified? Web.config? Control Markup? Both? Anywhere else?
    What are the required methods in a provider?

    FYI, I only need to make the scheduler control read-only.

    Thanks again!
  11. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 08 Nov 2011 Link to this post

    Hi Matt,

    The web.config of the sample is for .NET 4.0 (VS 2010). In addtion, you need to add a reference to the Telerik.Web.UI assembly. Let me know if you still experience problems.


    All the best,
    Peter
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  12. Matt
    Matt avatar
    29 posts
    Member since:
    Oct 2011

    Posted 08 Nov 2011 Link to this post

    Thanks. I'm well into creating my own provider now, and have a question about that.
    I'm working with ski instructor data to display their schedules to them. My datasource is objects that get returned from a DAL that talks to a COM object.
    It seems to be coming together, but I'm a little confused on how to implement the GetResourceTypes and GetResourcesByType methods of my provider.

    When this control is seen in my application, the user (instructor) has logged in already. So I'm dealing with a single resource type (instructor) as well as a single resource (this instructor)  at this point. How should I implement that in my GetResourceTypes and GetResourcesByType methods? Thanks again!

    To clarify, my data comes back with the field we use to track the resources always set to the same value. So for my instructor login, I get all "MATTB" in my resource column. It's possible we may expand this in the future to support managers looking at multiple schedules at once, but for now it's just a single instructor looking at their own schedule.

    Edit to add: I can now make my project run but I'm not seeing my appointments. Data is being fetched, but I think it's probably my implementation of resources that is making thing not show up.

    Matt
  13. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 11 Nov 2011 Link to this post

    Hi Matt,

    Please, refer to the Implementing A Provider help topic.

    If you continue to experience problems, I recommend you open a support ticket and send us a simple working demo of the issue.


    Kind Regards, Peter
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017