|
Query |
Response |
|
I am following the following tutorial,https://help.syncfusion.com/windowsforms/schedule/getting-started but I cannot find the file mentioned by "SimpleScheduleDataProvider.vb" since I program on vb.net and cannot find any file of example. |
Since from Essential Studio v11.2.0.25, the VB samples will not be available in the Dashboard and instead it will be provided only on demand. Here we have provided the samples for all windows forms controls in VB.Net. Please refer to the attached samples.
VB Samples link: https://s3.amazonaws.com/files2.syncfusion.com/dtsupport/forum/125611/ze/VBSampleWF_0129716163.zip
|
|
And another question it's posible to use a Datatable to get the items of calendar? |
By default, the data source for the Schedule control will be set as ScheduleDataProvider. So, the Schedule control does not have the direct support to set a data table as data source. However, any data source (i.e. binding list, data table) values can be retrieved to store the values as CustomScheduleDataProvider by implementing the ScheduleDataProvider. We have created a simple sample as per your requirement. Please make us of the below sample,
Sample link:http://www.syncfusion.com/downloads/support/directtrac/general/ze/Schedule_VB-1281029980
|
|
Query |
Response |
|
Is it possible to put it in read only mode so that the user cannot move items and cannot modify them when double clicking? |
The ReadOnly property of GetScheduleHost() can be used to restrict the editing on the schedule. However, the AppointForm forms will be displayed when cell double click is occurred and the items will be edited when time/item dragged. In order to avoid these scenarios, the ShowingAppointmentForm and ItemChanging events can be handled based on conditions. Please refer to the below code and sample,
Code example
'Event subscription
AddHandler Me.scheduleControl1.ShowingAppointmentForm, AddressOfscheduleControl1_ShowingAppointmentForm
'Event Customization
Private Sub scheduleControl1_ShowingAppointmentForm(ByVal sender As Object, ByVal eAs ShowingAppointFormEventArgs)
If grid.ReadOnly Then
e.Cancel = True
End If
End Sub
'Event triggering
AddHandler Me.scheduleControl1.ItemChanging, AddressOfScheduleControl1_ItemChanging
'Event Customization
Private Sub ScheduleControl1_ItemChanging(ByVal sender As Object, ByVal e AsScheduleAppointmentCancelEventArgs)
If e.Action = Syncfusion.Schedule.ItemAction.Edit OrElse e.Action = Syncfusion.Schedule.ItemAction.ItemDrag OrElse e.Action = Syncfusion.Schedule.ItemAction.Delete OrElse e.Action = Syncfusion.Schedule.ItemAction.Add OrElse e.Action = Syncfusion.Schedule.ItemAction.TimeDrag OrElse grid.ReadOnly Then
e.Cancel = True
End If
End Sub |
|
It is possible to assign an id to each task in the calendar and when clicking double click on it, get the id? |
You can create a custom AppointmentForm to store the id value and display the appointment on cell double click. And you can retrieve the values of current item when the AppointmentForm is displayed by using the item property in the ShowingAppointmentForm event. Please refer to the below KB to create a custom AppointmentForm.
|
|
Is it possible to modify the form that opens when double clicking? | |
|
how to change the language of the days of the week? |
The culture info for the Schedule control can be set to localize the week days by using the Culture property. Please make use of the below code,
Code example
‘Culture for Spanish - Spain
‘Please refer the below link:
‘To localize the week/month
Me.scheduleControl1.Culture = new CultureInfo("es-ES");
|
|
How to hide the number of the week? |
The calendar in the schedule control is loaded as GridControl which can be retrieved from the CalendarGrid of the NavigationCalendar. Moreover, the HidCols property can be used to hide the columns based on index. Please make use of the below code,
Code example
'To hide the count of weeks
Me.scheduleControl1.GetScheduleHost().Calendar.CalenderGrid.HideCols(1) = True |
|
In the menu that opens with right click it is possible to suppress all except day, work week, week and month? Can be translated? |
By default, the default strings of Schedule control will be retrieved from the DisplayStrings collection of ScheduleGrid (i.e. the “no closing delimiter error”, “From”, “To”). In order to localize the strings, the DisplayStrings static property of ScheduleGrid can be used. Please refer to the below code and sample,
Code example
//Custom string fro Delete Item of schedule control
ScheduleGrid.DisplayStrings(12) = "apagar item";
Note
The following is the definition for DisplayStrings array. You can specify the array index for default strings that has to be localized or changed.
//Default strings
public static string[] DisplayStrings = new string[]
{
"no closing delimiter error",
"(none)",
"Week starting ",
"Starting ",
" Double Click to Add All Day Event",
"To ",
"From ",
"Remove this appointment?",
"Remove Appointment",
"&New Item",
"New &All Day item",
"&Edit Item",
"De&lete Item",
"&Day",
"&Work Week",
"Wee&k",
"&Month",
"Click to switch to Day view",
"Click for more Appoinments."
};
|
|
Finally, you can modify the elements of the "show time as" list? |
The Schedule control does not have the direct support to modify the items of “Show time as” combo box. This can be achieved by overriding the InitLists() method of IScheduleDataProvider and adding the values to the list. Please refer to the below code and sample,
Code example
Public Overrides Sub InitLists()
MyBase.InitLists()
'To change the items of Show time as
markerList = New ListObjectList()
markerList.Add(New ListObject(0, "Livre", Color.FromArgb(50, Color.RoyalBlue))) '//same as noMarkColor
markerList.Add(New ListObject(1, "Tentativa", Color.FromArgb(255, 206, 206)))
markerList.Add(New ListObject(2, "Ocupado", Color.FromArgb(0, 0, 242)))
markerList.Add(New ListObject(3,"Fora do escritório", Color.FromArgb(128, 0, 64)))
End Sub
|
Hi Andrés,Thanks for your update.By default, the default strings of Schedule control will be retrieved from the DisplayStrings collection of ScheduleGrid (i.e. the “no closing delimiter error”, “From”, “To”). In order to localize the strings, the DisplayStrings static property of ScheduleGrid can be used. Please refer to the below code and sample,Code example//Custom string fro Delete Item of schedule controlScheduleGrid.DisplayStrings(12) = "apagar item";NoteThe following is the definition for DisplayStrings array. You can specify the array index for default strings that has to be localized or changed.//Default stringspublic static string[] DisplayStrings = new string[]{"no closing delimiter error","(none)","Week starting ","Starting "," Double Click to Add All Day Event","To ","From ","Remove this appointment?","Remove Appointment","&New Item","New &All Day item","&Edit Item","De&lete Item","&Day","&Work Week","Wee&k","&Month","Click to switch to Day view","Click for more Appoinments."};
|
'Event triggering
AddHandler scheduleControl1.ScheduleAppointmentClick, AddressOf ScheduleControl1_ScheduleAppointmentClick
'Event customization
Private Sub ScheduleControl1_ScheduleAppointmentClick(ByVal sender As Object, ByVal e As ScheduleAppointmentClickEventArgs)
If e.ClickType = ScheduleAppointmentClickType.RightClick AndAlso scheduleControl1.GetScheduleHost().ContextMenu IsNot Nothing Then
'To remove the "NewItem" menu item from the context menu.
scheduleControl1.GetScheduleHost().ContextMenu.MenuItems(0).Visible = False
End If |


|
Query |
Response |
|
1. I have tried the code that exposes me but it still does not work, the elements of the menu keep appearing, also watch your demo and keep appearing as you can see in the image: |
As per the Schedule control current support, the ContectMenu contains 8 items and 2 toolstripseperator to provide the better look and feel. Please find the order to ContextMenu items of ScheduleControl,
public ContextMenuStrip MetroContextMenu()
{
ContextMenuStrip menu = new ContextMenuStrip();
menu.Items.Add(New_Item);
menu.Items.Add(New_All_Day_item);
menu.Items.Add(ToolStripSeparator1);
menu.Items.Add(Edit_Item);
menu.Items.Add(Delete_Item);
menu.Items.Add(ToolStripSeparator2);
menu.Items.Add(Day);
menu.Items.Add(Work_Week);
menu.Items.Add(Week);
menu.Items.Add(Month);
}
So, the items can be hidden based on the index of the item by using the below code,
Code example
'Event customization
Private Sub ScheduleControl1_ScheduleAppointmentClick(ByVal sender As Object, ByVal eAs ScheduleAppointmentClickEventArgs)
If e.ClickType = ScheduleAppointmentClickType.RightClick AndAlsoscheduleControl1.GetScheduleHost().ContextMenu IsNot Nothing Then
'To remove the "WeekView" menu item from the context menu.
scheduleControl1.GetScheduleHost().ContextMenu.MenuItems(7).Visible = False
End If
|
|
2. I have seen that the small calendar does not appear on Monday See image: |
We have analyzed your scenario and hiding the 1st column hides Monday in the navigation calendar since the CalendarGrid starts from Monday and ends at Sunday. Moreover, the ScheduleGrid has the direct support to hide the number of weeks in the NavigationCalendar by using the ShowWeekNumbers property. Please refer to the below code,
Code example
'To hide the count of weeks
Me.scheduleControl1.GetScheduleHost().Calendar.ShowWeekNumbers = False
|
|
3. How is this literal changed? View image |
As we updated earlier to localize the “Week Starting” string of schedule control, the DisplayStrings collection of ScheduleGrid can be used based on the index. So, provide the proper index of the string in the DisplayStrings collection to the ScheduleGrid.DisplayStrings()collection. Moreover, the strings are added in the collection based on the below order,
//Default strings
public static string[] DisplayStrings = new string[] {
_no_closing_delimiter_error = 0;
_none = 1;
_week_starting = 2;
_starting = 3;
_Double_Click_to_Add_All_Day_Event = 4;
_To = 5;
_From = 6;
_Remove_this_appointment = 7;
_Remove_Appointment = 8;
_New_Item = 9;
_New_All_Day_item = 10;
_Edit_Item = 11;
_Delete_Item = 12;
_Day = 13;
_Work_Week = 14;
_Week = 15;
_Month = 16;
_Click_to_switch_to_Day_view = 17;
_Click_for_more_Appoinments = 18;
};
Code example
'To localize the "Week starting" string
ScheduleGrid.DisplayStrings(2) = "semana iniciando "
Note
Please let us know your use case elaborately, if we misunderstood your scenario.
|
|
'sample event handler to catch clicks on the schedule control.
Private Sub scheduleControl1_ScheduleAppointmentClick(ByVal sender As Object, ByVal eAs ScheduleAppointmentClickEventArgs)
If e.ClickType = ScheduleAppointmentClickType.RightClick AndAlsoscheduleControl1.GetScheduleHost().ContextMenuStrip IsNot Nothing Then
'To remove the "Work Week" menu item from the context menu.
scheduleControl1.GetScheduleHost().ContextMenuStrip.Items(7).Visible = False
End If
End Sub |
|
Query |
Response |
|
1. I have tried with its code to modify the literal but it still does not appear correctly it leaves "29 29e enero" when the correct thing would have to be "29 de enero", is it some translation failure? |
We have analyzed the reported scenario at our end. As per our ScheduleControl current support, the Culture will be applied based on the format of the WeekHeaderFormat and the format of the “d” will be replaced with the date. So that, the reported scenario occurred and to overcome this issue, the format can be set as “MMMM dd” by using the WeekHeaderFormat property. Please refer to the below code,
Code example
'To localize the week/month
Me.scheduleControl1.Culture = New CultureInfo("es-ES")
'To set the format for the header
Me.scheduleControl1.Appearance.WeekHeaderFormat = "MMMM dd"
|
|
2. From this painting I have managed to remove the letters, but I have tried with your guide the code to remove it and it does not work for me, maybe it does not work with the metro style? |
By default, the “Double Click to Add All Day Event” will be added in the top row of the navigation calendar hiding the row is working fine at our end. So, we are unable to understand your use case clearly and suspect that you have set the display string for “Double Click to Add All Day Event” as empty string by using the DisplayStrings collection. If you want to hide the entire row, please refer to the below KB link,
Note
Please let us know your exact requirement in a elaborated way, if we misunderstood your scenario. So, that we could provide you an optimal solution at the earliest. |