24 Answers, 1 is accepted
Thank you for contacting us. Please follow the step bellow:
1. Create a form that implements IEditAppointmentDialog or inherit the EditAppointmentDialog class. If you do not need some of the controls in the form, you can hide them.
2. Create an instance of your form.
3. Subscribe to the AppointmentEditDialogShowing event and replace the dialog on it. For additional information, please take a look at our Examples application, section Scheduler >> Data Binding.
If you have additional questions, feel free to ask.
All the best,
Dobry Zranchev
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.
public bool EditAppointment(Telerik.WinControls.UI.IEvent appointment, Telerik.WinControls.UI.ISchedulerData schedulerData) |
{ |
} |
public void ShowRecurrenceDialog() |
{ |
} |
I can add the custom fields to the form but the data is not binding. Here is my full code listing of the main form where I amd binding to the data
Imports Telerik.WinControls.UI |
Imports Telerik.WinControls.UI.Scheduler |
Imports Telerik.WinControls.UI.Scheduler.Dialogs |
Public Class frmScheduler |
Protected Overloads Overrides Sub OnLoad(ByVal e As EventArgs) |
MyBase.OnLoad(e) |
Me.RadSchedule.AppointmentFactory = New AppointmentFactoryClass() |
' Me.RadSchedule.AppointmentEditDialogShowing += New EventHandler(Of AppointmentEditDialogShowingEventArgs)(RadSchedule_AppointmentEditDialogShowing) |
AddHandler RadSchedule.AppointmentEditDialogShowing, AddressOf RadSchedule_AppointmentEditDialogShowing |
BindToDataSource() |
End Sub |
Private appointmentDialog As IEditAppointmentDialog = Nothing |
Sub RadSchedule_AppointmentEditDialogShowing(ByVal sender As Object, ByVal e As AppointmentEditDialogShowingEventArgs) |
If Me.appointmentDialog Is Nothing Then |
Me.appointmentDialog = New CustomTelerikForm2() |
End If |
e.AppointmentEditDialog = Me.appointmentDialog |
End Sub |
Private Sub BindToDataSource() |
Me.AppointmentsResourcesTableAdapter.Fill(Me.SomeDataSet.AppointmentsResources) |
Me.ResourcesTableAdapter.Fill(Me.SomeDataSet.Resources) |
Me.AppointmentsTableAdapter.Fill(Me.SomeDataSet.Appointments) |
' create and assign appointment mapping |
Dim appointmentMappingInfo As New AppointmentMappingInfo() |
appointmentMappingInfo.Start = "Start" |
appointmentMappingInfo.[End] = "End" |
appointmentMappingInfo.Summary = "Summary" |
appointmentMappingInfo.Description = "Description" |
appointmentMappingInfo.Location = "Location" |
appointmentMappingInfo.BackgroundId = "BackgroundID" |
'appointmentMappingInfo.StatusId = "StatusID" |
appointmentMappingInfo.RecurrenceRule = "RecurrenceRule" |
appointmentMappingInfo.Resources = "FK_AppointmentsResources_Appointments" |
appointmentMappingInfo.ResourceId = "ResourceID" |
SchedulerBindingDataSource1.EventProvider.Mapping = appointmentMappingInfo |
SchedulerBindingDataSource1.EventProvider.DataSource = SomeDataSet.Appointments() |
' create and assign resource mapping |
Dim resourceMappingInfo As New ResourceMappingInfo() |
resourceMappingInfo.Id = "ID" |
resourceMappingInfo.Name = "Name" |
SchedulerBindingDataSource1.ResourceProvider.Mapping = resourceMappingInfo |
SchedulerBindingDataSource1.ResourceProvider.DataSource = SomeDataSet.Resources() |
' assign mapped binding data source |
RadSchedule.DataSource = SchedulerBindingDataSource1 |
Me.RadSchedule.GroupType = GroupType.Resource |
Dim dataSource As New SchedulerBindingDataSource() |
dataSource.EventProvider.AppointmentFactory = Me.RadSchedule.AppointmentFactory |
appointmentMappingInfo.Mappings.Add(New SchedulerMapping("Email", "Email")) |
End Sub |
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click |
' save scheduler changes |
AppointmentsTableAdapter.Update(SomeDataSet.Appointments) |
AppointmentsResourcesTableAdapter.Update(SomeDataSet.AppointmentsResources) |
End Sub |
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click |
Me.Close() |
Application.Exit() |
End Sub |
End Class |
I have updated the code snippet for you:
Private
Sub
BindToDataSource()
Me
.AppointmentsResourcesTableAdapter.Fill(
Me
.SomeDataSet.AppointmentsResources)
Me
.ResourcesTableAdapter.Fill(
Me
.SomeDataSet.Resources)
Me
.AppointmentsTableAdapter.Fill(
Me
.SomeDataSet.Appointments)
Dim
schedulerBindingDataSource
As
New
SchedulerBindingDataSource
' create and assign appointment mapping
Dim
appointmentMappingInfo
As
New
AppointmentMappingInfo()
Dim
dataSource
As
New
SchedulerBindingDataSource()
dataSource.EventProvider.AppointmentFactory =
Me
.RadSchedule.AppointmentFactory
appointmentMappingInfo.Mappings.Add(
New
SchedulerMapping(
"Email"
,
"Email"
))
appointmentMappingInfo.Start =
"Start"
appointmentMappingInfo.[
End
] =
"End"
appointmentMappingInfo.Summary =
"Summary"
appointmentMappingInfo.Description =
"Description"
appointmentMappingInfo.Location =
"Location"
appointmentMappingInfo.BackgroundId =
"BackgroundID"
'appointmentMappingInfo.StatusId = "StatusID"
appointmentMappingInfo.RecurrenceRule =
"RecurrenceRule"
appointmentMappingInfo.Resources =
"FK_AppointmentsResources_Appointments"
appointmentMappingInfo.ResourceId =
"ResourceID"
schedulerBindingDataSource.EventProvider.Mapping = appointmentMappingInfo
schedulerBindingDataSource.EventProvider.DataSource = SomeDataSet.Appointments()
' create and assign resource mapping
Dim
resourceMappingInfo
As
New
ResourceMappingInfo()
resourceMappingInfo.Id =
"ID"
resourceMappingInfo.Name =
"Name"
schedulerBindingDataSource.ResourceProvider.Mapping = resourceMappingInfo
schedulerBindingDataSource.ResourceProvider.DataSource = SomeDataSet.Resources()
' assign mapped binding data source
RadSchedule.DataSource = schedulerBindingDataSource
Me
.RadSchedule.GroupType = GroupType.Resource
End
Sub
I hope that this helps. If not, please provide an sample example in order to give you more appropriate help.
Best wishes,
Dobry Zranchev
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.
There are 2 options. The first one is to customize the existing EditAppointmentDialog. This is demonstrated in the Data Binding example of the Examples project. I would suggest that you take a look at the demo's source code. You can also refer to our online help documentation as there is a topic which describes how to customize the dialog: http://www.telerik.com/help/winforms/overview.html.
The second option is to create a completely new EditAppointmentDialog with custom controls and custom fields.We are currently working on a demo which demonstrates how to do this. If you are interested in it, please let me know.
I hope this helps.
Sincerely yours,
Boyko Markov
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.
Thanks for your answer, the full customization of the Appointment dialog will be appreciated by the community. I have not yet palyed around with this feature yet.
Thanks
JJ
You can find attached a sample which shows how to create a completely new EditAppointmentDialog and then associate it to the RadScheduler's instance.
Please feel free to post your feedback.
All the best,
Boyko Markov
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.
I have adding a new field like "Email" as above steps
but my field is a ForeignKey to another by Sense1" style="line-height: 20px; text-decoration: underline !important; border: none !important; display: inline-block !important; float: none !important; font-weight: bold !important; height: auto !important; margin: 0px !important; min-height: 0px !important; min-width: 0px !important; padding: 0px !important; text-transform: uppercase !important; vertical-align: baseline !important; width: auto !important; background: transparent !important;">TABLE
when the value is changed got an by Sense1" style="line-height: 20px; text-decoration: underline !important; border: none !important; display: inline-block !important; float: none !important; font-weight: bold !important; height: auto !important; margin: 0px !important; min-height: 0px !important; min-width: 0px !important; padding: 0px !important; text-transform: uppercase !important; vertical-align: baseline !important; width: auto !important; background: transparent !important;">EXCEPTION 'ReferenceAlreadyHasValueException'
Thank you for writing.
In this case you should manually convert the value using the foreign key. More Information is available here: Scheduler Mapping.
I hope this will be useful.
Regards,
Dimitar
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
I have added a new column 'ServiceId' ForeignKey and when have changed an Exception thrown
"ForeignKeyReferenceAlreadyHasValueException"
Please Help
Thank you for writing back.
I am not sure how we can reproduce this on our side. I have bound the scheduler to a custom field in such scenario, but as long as valid values are provided there is no exception. This makes me think that perhaps something in your database should be changed. This is why following the provided information I have created a small sample project which contains modified version of the scheduler sample database. When the appointment dialog is opened you will notice the custom field. Currently the valid values for it is "1" or "2" since the test table contains only two rows. Could you please check it and let me know how it fits in your case?
Regards,
Dimitar
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
Thanks for your replies,
The problem solved but I have another question.
How to print Appointments with LOCALIZATION, specifically the Calendar at the title.
thanks in advance,
Best regards.
Thank you for writing back
This is currently not supported out of the box. I added a feature request for this in our Feedback Portal. You can track the item for status changes and add your vote for it here.
Currently you can manually set the culture of the print elements, the month name however needs to be painted manually:
void
radScheduler1_PrintElementFormatting(
object
sender, PrintElementEventArgs e)
{
Console.WriteLine(e.PrintElement);
CalendarPrintElement el = e.PrintElement
as
CalendarPrintElement;
if
(el !=
null
)
{
el.DateTimeFormat =
new
CultureInfo(
"bg-BG"
).DateTimeFormat;
}
}
void
radScheduler1_PrintElementPaint(
object
sender, PrintElementPaintEventArgs e)
{
SchedulerPrintCellElement element = e.PrintElement
as
SchedulerPrintCellElement;
if
(element !=
null
)
{
element.Text = element.Date.ToString(element.DateFormat,
new
CultureInfo(
"bg-BG"
));
}
CalendarPrintElement el = e.PrintElement
as
CalendarPrintElement;
if
(el !=
null
)
{
var graphics = e.Graphics;
StringFormat headerFormat =
new
StringFormat() { Alignment = StringAlignment.Center };
var rect =
new
Rectangle(e.Bounds.X + 2, e.Bounds.Y, e.Bounds.Width - 4, 15);
string
monthName = el.Date.ToString(
"MMMM"
,
new
CultureInfo(
"bg-BG"
));
graphics.FillRectangle(Brushes.White, rect);
graphics.DrawString(monthName,
new
Font(el.Font.Name,9,FontStyle.Regular), Brushes.Black, rect, headerFormat);
}
}
Your Telerik Points have been updated for this report.
Should you have any other questions do not hesitate to ask.
Regards,
Dimitar
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
when PrintStyle.DrawPageTitleCalendar is set to True
and CultureInfo("ar-SA")
there's an exception 'Valid values are between 1318 and 1500, inclusive.'
Thanks for your usual cooperation,
Best regards
but about 'SchedulerTimelineView' and 'SchedulerMonthView' there's still a problem.
Thanks a lot for your replies.
Thank you for writing back.
Indeed the sample code does not cover all the print styles. To cover all cases you should use the CellPrintElementFormatting event as well:
void
radScheduler1_CellPrintElementFormatting(
object
sender, PrintSchedulerCellEventArgs e)
{
if
(e.CellElement.DateFormat !=
null
)
{
e.CellElement.Text = e.CellElement.Date.ToString(e.CellElement.DateFormat,
new
CultureInfo(
"bg-BG"
));
}
}
In addition you should format the month header text in the PrintElementFormatting event:
void
radScheduler1_PrintElementFormatting(
object
sender, PrintElementEventArgs e)
{
CalendarPrintElement el = e.PrintElement
as
CalendarPrintElement;
if
(el !=
null
)
{
el.DateTimeFormat =
new
CultureInfo(
"bg-BG"
).DateTimeFormat;
}
RadPrintElement element = e.PrintElement;
if
(element !=
null
&& element.AngleTransform == -90)
{
string
[] temp = element.Text.Split(
'-'
);
if
(temp.Length > 0)
{
DateTime startOfWeek = DateTime.Parse(temp[0]);
element.Text = startOfWeek.ToString(
"MMM dd"
,
new
CultureInfo(
"bg-BG"
)) +
" - "
+ startOfWeek.AddDays(6).ToString(
"MMM dd"
,
new
CultureInfo(
"bg-BG"
));
}
}
}
Please let me know if there is something else I can help you with.
Dimitar
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
This is extremely helpful. Is there any chance you could upload a VB .NET example?
Thank you for writing.
I am not sure which example you are pointing. Nevertheless in both cases you can use our online converter to convert the code to Visual Basic.
Do not hesitate to contact us if you have other questions.
Dimitar
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
I am using radscheduler in a web form application, I have watch the video on this link
http://tv.telerik.com/watch/winforms/radscheduler/adding-custom-fields-radscheduler-winforms-appointments
about using scheduler with custom attributes, as I am using web form application so I need a tutorial on this in which custom values being used and all teh crud operations is being performed. Thank you!
This is the WinForms forum and the specified video contains a solution for the WinForms scheduler. Unfortunately, this solution does not apply for WebForms applications. This is why I want to kindly ask you to post your question in the appropriate forum section: Forum threads about Scheduler UI for ASP.NET AJAX.
Thank you for your understanding.
Regards,
Dimitar
Telerik
See What's Next in App Development. Register for TelerikNEXT.