This is a migrated thread and some comments may be shown as answers.

[Solved] Error on data binding

3 Answers 157 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Billy Pham
Top achievements
Rank 1
Billy Pham asked on 30 Jul 2009, 02:48 PM
I got this compilation error when I try to use the data binding

 <telerik:RadScheduler runat="server" ID="DisplayAllBookings"
............
OnDataBinding="onDataBinding">

Here's my javascript:

        function onDataBinding(sender, arg) {
            alert("Data binding");
        }

I got this compilation error:

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1061: 'ASP.booking_displayallbooking_aspx' does not contain a definition for 'onDataBinding' and no extension method 'onDataBinding' accepting a first argument of type 'ASP.booking_displayallbooking_aspx' could be found (are you missing a using directive or an assembly reference?)

Can anyone explain why I got this and how to resolve the problem?

Another question: basically I gonna have different number on each time slot and I want to use different colors to display time slots with various number. What I try to do is to modify the color of each time slot upon DataBinding. Apart from writing scripts for OnDataBinding, is there any easier way to do this?

Thank you very much.



3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 31 Jul 2009, 11:04 AM
Hello Billy,

OnDataBinding is a server event and you treat it as a client event, hence the error.

I recommend you use TimeSlotCreated to achieve your goal. The following kb article will help you get started: http://www.telerik.com/support/kb/aspnet-ajax/scheduler/setting-special-days-or-time-slots-in-radscheduler.aspx


Greetings,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Billy Pham
Top achievements
Rank 1
answered on 01 Aug 2009, 02:37 PM
Thank you Peter. It works as what I want.

However, when I set the background of all time slots to a particular color (say red), most of the slots have that color but some don't have. Do you know why it is?

Here is the picture for your reference.

http://img11.imageshack.us/img11/7279/screenkzh.jpg

I set all the time slot to have the same color in my code:

        protected void DisplayAllBookings_OnTimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
        {
            e.TimeSlot.CssClass = "TimeSlotCSS";
        }
0
Accepted
Peter
Telerik team
answered on 03 Aug 2009, 05:55 AM
Hello Billy,

The weekend days render a special css class - rsSunCol or rsSatCol, so the specificity of your css selector is not strong enough for those days. Please, use "!important":

.CustomCssClass
{
    background: green !important;
}

All the best,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Scheduler
Asked by
Billy Pham
Top achievements
Rank 1
Answers by
Peter
Telerik team
Billy Pham
Top achievements
Rank 1
Share this question
or