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

Value cannot be null. Parameter name: expression in Appoinment Binding

3 Answers 866 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
kasi
Top achievements
Rank 1
kasi asked on 06 Jul 2011, 08:09 AM
Hi,
    When i am binding appointment from database i faceing the following error Value cannot be null. Parameter name: expression. Please Look the my code below
<telerik:RadScheduler runat="server" ID="RadScheduler1" Height="585px" SelectedDate="2010-03-04"
FirstDayOfWeek="Saturday" LastDayOfWeek="Thursday" DataKeyField="ActivityId" 
DataSubjectField="Subject" DataDescriptionField="Description" DataStartField="Start"
 ShowFooter="true" ShowHeader="true" DataEndField="End" CustomAttributeNames="Location"
 StartInsertingInAdvancedForm="true" StartEditingInAdvancedForm="true" EnableExactTimeRendering="true"
Skin="Windows7" EnableDescriptionField="true" DataReminderField="Reminder" AppointmentStyleMode="Default"
OnNavigationComplete="RadScheduler1_NavigationComplete" OnAppointmentCreated="RadScheduler1_AppointmentCreated"
OnAppointmentDataBound="RadScheduler1_AppointmentDataBound">
 <AdvancedForm EnableCustomAttributeEditing="true" EnableResourceEditing="true" Modal="true" />
      <TimelineView UserSelectable="false" />
              <Reminders Enabled="true" />
                   <ResourceTypes>
                                        <telerik:ResourceType Name="Category" DataSourceID="odsScheduleCategory" ForeignKeyField="CategoryID"
                                            TextField="ColorCategory" KeyField="CategoryID" />
                                    </ResourceTypes>
                                    <ResourceStyles>
                                        <%--AppointmentStyleMode must be explicitly set to Default (see above) otherwise setting BackColor/BorderColor
                            will switch the appointments to Simple rendering (no rounded corners and gradients)--%>
                                        <%--<telerik:ResourceStyleMapping Type="Category" Text="ColorCategory" ApplyCssClass="rsCategoryBlue"
                                            BorderColor="#B0CC9B" />
                                        <telerik:ResourceStyleMapping Type="Category" Text="Green Category" ApplyCssClass="rsCategoryGreen" />
                                        <telerik:ResourceStyleMapping Type="Category" Text="ColorCategory" BackColor="#edd5b7"
                                            BorderColor="#cdb597" />--%>
                                    </ResourceStyles>
                                    <AppointmentTemplate>
                                        <div>
                                            <%# Eval("Subject") %>
                                        </div>
                                        <%# Eval("Description") %>
                                        <%#Eval("Location")%>
                                        <%#Eval("Start")%>
                                        <%#Eval("End")%>
                                        <%#Eval("ShowAs")%>
                                    </AppointmentTemplate>
                                    <%--<AdvancedInsertTemplate>
                                        <telerik:RadTextBox ID="txtLocation" runat="server" Label="Location :" Skin="Windows7">
                                        </telerik:RadTextBox>
                                    </AdvancedInsertTemplate>--%>
                                    <TimeSlotContextMenuSettings EnableDefault="true" />
                                    <AppointmentContextMenuSettings EnableDefault="true" />
                                </telerik:RadScheduler>
RadScheduler1.DataSource = dt
           RadScheduler1.DataBind()

3 Answers, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 06 Jul 2011, 08:32 AM
Hello Kasi,

Unfortunately the provided information is not enough for me to tell you where is the problem. Could you please be more specific on where did you receive this error and what is the exactly error message.

Also one thing that I can advice you at this moment is to check the design of your database and compare it with our database structure. Check whether the "Allow Nulls" field is the same for all fields as in our structure.

Best wishes,
Veronica Milcheva
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
kasi
Top achievements
Rank 1
answered on 06 Jul 2011, 08:53 AM
Hi,
We are using Out Customized DataStructure and From Us there was no filed for RoomID and RecurrenceRule. I can able to insert the appointment but when i select the appointments i m using function thats Called on Page Load, I am not using any provider , I m just binding same like Grid.I dont know where and which field its getting error.  Please help on this urgent
Private Sub BindAppointments()
        
            StartTime = RadScheduler1.SelectedDate
            EndTime = RadScheduler1.SelectedDate
            UserID = Session("UserID")
            dt = BAL.SelectActivity(StartTime, EndTime, UserID)
            RadScheduler1.DataSource = dt
                  RadScheduler1.DataBind()
End Sub

0
Veronica
Telerik team
answered on 12 Jul 2011, 08:29 AM
Hello Kasi,

Please accept my apologies for the late reply. I was helping for the upcomming Release and didn't have time to respond you.

Please note that I am not able to help you or give you any advices unless I see your code. "I m just binding same like Grid" - please note that RadGrid is bound by 11 different ways as can be seen by the count of the demos in the "Populating with Data" section.

Could you please send me your code as well as the database so I can inspect it and help you?
Thank you!

Greetings,
Veronica Milcheva
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Scheduler
Asked by
kasi
Top achievements
Rank 1
Answers by
Veronica
Telerik team
kasi
Top achievements
Rank 1
Share this question
or