search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Select multiple events from code

Asked by Malik
6 years ago.

Hello,

Could someone advise on how to select multiple events from VB.NET code and render them as selected?

Thanks,
Malik

Answer posted by Dan Letecky [DayPilot]
6 years ago.

Unfortunately, the Lite edition doesn't support event selecting.

In the Pro version, you can select the events using SelectedEvents list (in the Scheduler). It's a list of simplified EventInfo objects that only require the event id.

Example:

DayPilotScheduler1.SelectedEvents.Add(EventInfo.Create("123"))

Where "123" is the event id. You can add multiple events to the selection this way.

Comment posted by Mathieu
6 years ago.

Hello Dan,

Thanks for your reply.
Actually, I'm using Pro Edition.

My context is that I added a "Select all" button in my web page to have multiple events selected.
I'm using the code below but the concerned events are not rendered as selected.

Dim ei As EventInfo = EventInfo.Create(eo.IDEVENT)
dayPilotScheduler.SelectedEvents.Add(ei)

I do this during the PreRender event of my ASP.NET page.

Could you please advise?

Thanks,
Malik

Comment posted by Dan Letecky [DayPilot]
6 years ago.

Hi Malik,

Have you tried adding this code to the Click event handler of the "Select all" button?

Comment posted by Mathieu
6 years ago.

Hi Dan,

I tried to do it but it didn't work as the PreRender function is called after the click event handler of the "Select all" button. The daypilotscheduler is updated inside the PreRender function so that's where I need to apply the selection of multiple events in the scheduler.

Comment posted by Mathieu
6 years ago.

Hi Dan,

Could you please advise if you have in mind some solutions to be able to select multiple events?

Thanks,
Malik

Comment posted by Dan Letecky [DayPilot]
6 years ago.

I did a few tests and there seems to be a problem with setting the selection on the server side. I'm checking the issue.

Comment posted by Dan Letecky [DayPilot]
6 years ago.

Just a question: Is it necessary to select the events on the server side? The feature is designed to be used on the client-side and it's much easier and faster to select the events using JavaScript, without a PostBack.

Comment posted by Mathieu
6 years ago.

Hi Dan,

Regarding the global design of the project/solution I'm working on, it would be better to select events on server side.

Thanks,
Malik

Comment posted by Mathieu
6 years ago.

Hi Dan,

Do you think you can come up with a solution to be able to select the events on server side?

Thanks,
Malik

Comment posted by Anonymous
6 years ago.

Hi Dan,

I am working with malik.

Is it a referenced bug in daypilot pro ?
We have to deliver this feature in two weeks time so we need to know how daypilot stands with this issue.

thanks

mathieu

Comment posted by Dan Letecky [DayPilot]
6 years ago.

Hi Mathieu, Malik,

The implementation is in progress and should be completed by the end of this week. I'll post an update here when it's available.

Comment posted by Mathieu
6 years ago.

Hi Dan

Thanks, that's a great news !

if fix is available at the end of the week it should fit in our release plan.
How do you plan to provide this fix ?
We are currently using day pilot pro for asp.net webforms 8.0.3413.0 and I don't think it will be possible to update to new version of day pilot in this app release.
I need to push this upgarde into the changes approved and it will require some time to do regression testing.

Do you think you can provide the code chnages so we can apply it directly ourselve ?

Thanks

Mathieu

Comment posted by Dan Letecky [DayPilot]
6 years ago.

Unfortunately, this change requires multiple changes at different locations. Moreover, version 8.0 is more than 3 years old and there were many changes implemented meanwhile.

If you need to implement this feature for a tight deadline and don't want to upgrade to the latest DayPilot Pro version, I recommend using the client-side API (DayPilot.Scheduler.multiselect.*). When you are ready to upgrade you can switch to the server-side solution.

Comment posted by Anonymous
6 years ago.

Hi Dan,

Any update on the release of the fix ?

Thanks

mathieu

Comment posted by Dan Letecky [DayPilot]
6 years ago.

Hi Mathieu,

The fix is now available as part of the latest release:
https://aspnet.daypilot.org/daypilot-pro-for-asp-net-webforms-2018-3-3671/

Let me know if it doesn't work as expected.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.