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

End Date not populationg correctly in Bind Rad Scheduler to a Sharepoint List

5 Answers 64 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
smith spd
Top achievements
Rank 1
smith spd asked on 14 Jul 2010, 09:28 PM

Hello Telerik Team,

I have developed a scheduler which pulls data from sharepoint list.But i could see that the end date
does not show up correctly.Please anyone can guide me .

Thank you
Smith

5 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 21 Jul 2010, 10:54 AM
Hello,

Can you please share some additional details? Does the End date get populated at all or is it populated with wrong data?

We have a running sample of RadScheduler in SharePoint 2010 site. Here's how the data binding code looks there:

using (var site = new SPSite("http://localhost"))
{
    using (var web = site.OpenWeb())
    {
        var list = web.Lists["SchedulerEvents"];
        RadScheduler1.DataSource = list.Items.GetDataTable();
        RadScheduler1.DataSubjectField = "Title";
        RadScheduler1.DataStartField = "Start";
        RadScheduler1.DataEndField = "End";
        RadScheduler1.DataKeyField = "ID";
        RadScheduler1.DataRecurrenceField = "RecurrenceRule";
        RadScheduler1.DataRecurrenceParentKeyField = "RecurrenceParentID";
        RadScheduler1.DataBind();
    }
}

I hope this helps.

Kind regards,
Tsvetomir Tsonev
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
0
smith spd
Top achievements
Rank 1
answered on 05 Aug 2010, 05:32 PM
Hello telerik team,

Thank you for the response.I am able to get the end date but it appears as 1 DAY less than the original end date and how do you validate whether start date is less than end date in the above code.

Thank you
Smith
0
T. Tsonev
Telerik team
answered on 11 Aug 2010, 01:22 PM
Hello,

Can you please show us how the data looks in the SharePoint list?

The validation for start and end date will be done as soon as the data is obtained from the data source. It must be valid at this point.

I hope this helps.

Sincerely yours,
Tsvetomir Tsonev
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
0
smith spd
Top achievements
Rank 1
answered on 11 Aug 2010, 07:47 PM
Hello Telerik team,

The code which i am using to bind the scheduler to list is below.
{

 

String stUrl = SPContext.Current.Web.Url.ToString();

spSite =

new SPSite(stUrl);

 

site = spSite.OpenWeb();

 

 

listItems = site.Lists[

"TestList"].Items;

 

site.AllowUnsafeUpdates =

true;

 


 

DataTable DTable = listItems.GetDataTable();

 


RadScheduler1.DataSource = DTable;
}

I wanted to add only those records(list items)  to DTable for which  start date and time is earlier than end date and time.

I appreciate your response.

Thank you
Smith

0
T. Tsonev
Telerik team
answered on 12 Aug 2010, 04:43 PM
Hi,

The best approach would be to let SharePoint do the filtering for us. The preferred option is to use LINQ to SharePoint. The SPQuery class should come handy for older versions of SharePoint.

I hope this helps.

Greetings,
Tsvetomir Tsonev
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
Tags
Scheduler
Asked by
smith spd
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
smith spd
Top achievements
Rank 1
Share this question
or