Telerik Forums
UI for WinForms Forum
2 answers
283 views
Hi,

I used Custom Field for scheduler control. And I watched Adding Custom Fields to RadScheduler for WinForms Appointments. And I read online help. I did it same things.

My problem,  

        It can't cast IEvent object to NewAppointmentObject on ApplySettingsToEvent.. NewAppointmentObject is inherited from Appointment Class.. Its code is following.

using System;  
using System.Collections.Generic;  
using System.Text;  
using Telerik.WinControls;  
using Telerik.WinControls.UI;  
 
namespace LearnRadScheduler  
{  
    public class NewAppointmentObject : Appointment  
    {  
        public NewAppointmentObject()  
            : base()  
        {  
 
        }  
 
        private string subjectEN = string.Empty;  
        public string SubjectEN  
        {  
            get { return this.subjectEN; }  
            set  
            {  
                if (this.subjectEN != value)  
                {  
                    this.subjectEN = value;  
                    this.OnPropertyChanged("SubjectEN");  
                }  
            }  
        }  
 
        private string locationEN = string.Empty;  
        public string LocationEN  
        {  
            get { return this.locationEN; }  
            set  
            {  
                if (this.locationEN != value)  
                {  
                    this.locationEN = value;  
                    this.OnPropertyChanged("LocationEN");  
                }  
            }  
        }  
 
        private string descriptionEN = string.Empty;  
        public string DescriptionEN  
        {  
            get { return this.descriptionEN; }  
            set  
            {  
                if (this.descriptionEN != value)  
                {  
                    this.descriptionEN = value;  
                    this.OnPropertyChanged("DescriptionEN");  
                }  
            }  
        }     
    }  
}  
 

I run the project, All appointments are coming to screen in Scheduler control. But I select an appointment, showing my custom edit dialog and getting all values. No problem. I want to add new appointment. I click empty line and openning CustomAppointmentEditDialog. I write some things. I click OK button. But I bought an exception. Is is following.

Exception Message :

Property accessor 'SubjectEN' on object 'Telerik.WinControls.UI.Appointment' threw the following exception:'Object does not match target type.' 

Stack Trace :

"   at System.ComponentModel.ReflectPropertyDescriptor.GetValue(Object component)\r\n   at Telerik.WinControls.UI.Scheduler.BindingProviderBase`1.UpdateDataItemProperty(Object item, T schedulerItem, SchedulerMapping mapping)\r\n   at Telerik.WinControls.UI.Scheduler.BindingProviderBase`1.UpdateDataItemProperties(Object item, T schedulerItem)\r\n   at Telerik.WinControls.UI.Scheduler.BindingProviderBase`1.InsertCore(T itemToInsert)\r\n   at Telerik.WinControls.UI.SchedulerBindingDataSource.EventBindingProvider.InsertCore(IEvent itemToInsert)\r\n   at Telerik.WinControls.UI.Scheduler.BindingProviderBase`1.Insert(T itemToInsert)\r\n   at Telerik.WinControls.UI.RadScheduler.OnAddAppointments(IList list)\r\n   at Telerik.WinControls.UI.RadScheduler.appointments_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)\r\n   at Telerik.WinControls.Data.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)\r\n   at Telerik.WinControls.Data.ObservableCollection`1.NotifyListenersCollectionChanged(NotifyCollectionChangedEventArgs e)\r\n   at Telerik.WinControls.Data.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)\r\n   at Telerik.WinControls.Data.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedAction action, Object item, Int32 index)\r\n   at Telerik.WinControls.Data.ObservableCollection`1.InsertItem(Int32 index, T item, Action`1 approvedAction)\r\n   at Telerik.WinControls.Data.ObservableCollection`1.InsertItem(Int32 index, T item)\r\n   at Telerik.WinControls.UI.SchedulerAppointmentCollection.InsertItem(Int32 index, IEvent item)\r\n   at System.Collections.ObjectModel.Collection`1.Add(T item)\r\n   at Telerik.WinControls.UI.RadScheduler.AddNewAppointmentWithDialog(DateTimeInterval interval, Boolean recurringAppointment, SchedulerResourceCollection resources)\r\n   at Telerik.WinControls.UI.DayViewAppointmentsTable.cell_DoubleClick(Object sender, EventArgs e)\r\n   at Telerik.WinControls.RadItem.OnDoubleClick(EventArgs e)\r\n   at Telerik.WinControls.RadItem.DoDoubleClick(EventArgs e)\r\n   at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)\r\n   at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)\r\n   at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)\r\n   at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)\r\n   at Telerik.WinControls.RadElement.DoMouseUp(MouseEventArgs e)\r\n   at Telerik.WinControls.ComponentInputBehavior.OnMouseUp(MouseEventArgs e)\r\n   at Telerik.WinControls.RadControl.OnMouseUp(MouseEventArgs e)\r\n   at Telerik.WinControls.UI.RadScheduler.OnMouseUp(MouseEventArgs e)\r\n   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)\r\n   at System.Windows.Forms.Control.WndProc(Message& m)\r\n   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)\r\n   at Telerik.WinControls.RadControl.WndProc(Message& m)\r\n   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\r\n   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)\r\n   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)\r\n   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)\r\n   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)\r\n   at System.Windows.Forms.Application.Run(ApplicationContext context)\r\n   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()\r\n   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()\r\n   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)\r\n   at KocSchool_Grades.TestProject.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81\r\n   at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)\r\n   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)\r\n   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n   at System.Threading.ThreadHelper.ThreadStart()" 

    This code ,
        NewAppointmentObject newAppObj = ev as NewAppointmentObject;  
    
    return null.. 
    
I think, it can not do casting. 
    NewAppObj return NULL after casting.. !!

        protected override void ApplySettingsToEvent(Telerik.WinControls.UI.IEvent ev)  
        {  
            NewAppointmentObject newAppObj = ev as NewAppointmentObject;  
 
            if (newAppObj != null)  
            {  
                newAppObj.SubjectEN = this.txtSubjectEN.Text;  
                newAppObj.LocationEN = this.txtLocationEN.Text;  
                newAppObj.DescriptionEN = this.txtDescriptionEN.Text;  
            }  
 
            base.ApplySettingsToEvent(ev);  
        } 

    I did it same things in help document. My WinForms controls version is 2009 Q3, but same code was running my previous version that is 2008 Q2.

from now, thanks for all helps..
KocSchool
Top achievements
Rank 2
 answered on 01 Dec 2009
1 answer
130 views
HI,

In RadScheduler by setting RulerStartScale I can specify starting time of dayview. Type of RulerStartScale is integer so I have to pass integer as starting time. But It sets hour only, I want to set Hour and Minutes as starting time. For example by setting RulerStartScale=11 will set Starting time from 11. But What should I do if I want starting time for ruler time as 11.30..??
Boyko Markov
Telerik team
 answered on 01 Dec 2009
0 answers
229 views
To prevent possible data loss before loading the designer  the following errors must be resolved

at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.Throw(String res)
at System.Xml.XmlTextReaderImpl.ParseEntityName()
at System.Xml.XmlTextReaderImpl.ParseAttributeValueSlow(Int32 curPos, Char quoteChar, NodeData attr)
at System.Xml.XmlTextReaderImpl.ParseAttributes()
at System.Xml.XmlTextReaderImpl.ParseElement()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlTextReader.Read()
at Microsoft.VisualStudio.Design.VSTypeResolutionService.GeneratedAssemblyEntry.RealizeMoniker(String moniker)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.GeneratedAssemblyEntry.get_FileName()
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.get_Assembly()
at Microsoft.VisualStudio.Design.VSTypeResolutionService.GeneratedAssemblyEntry.get_Assembly()
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.Search(String fullName, String typeName, Boolean ignoreTypeCase, Assembly& assembly, String description)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchGeneratedEntries(AssemblyName assemblyName, String typeName, Boolean ignoreTypeCase, Assembly& assembly)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchEntries(AssemblyName assemblyName, String typeName, Boolean ignoreCase, Assembly& assembly, ReferenceType refType)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, ReferenceType refType)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name, Boolean throwOnError)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.GetType(ITypeResolutionService trs, String name, Dictionary`2 names)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.FillStatementTable(IDesignerSerializationManager manager, IDictionary table, Dictionary`2 names, CodeStatementCollection statements, String className)
at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)

how can i solve this error
Any one can help me!!!
Regards,
vignesh



kottu
Top achievements
Rank 1
 asked on 01 Dec 2009
3 answers
280 views
I added GridViewComboBoxColumn per the help files. http://www.telerik.com/help/winforms/grid_gridviewcomboboxcolumn.html

What I am trying to figure out is how to make the values in the combobox distinct.  Is there a property or setting to do this or do I have to programmically remove all of the dups?

Thanks
Stephen

 

steve
Top achievements
Rank 1
 answered on 30 Nov 2009
6 answers
185 views

Hello,

i am working on a localization provider for the RadScheduler. 

I get the following problems:

1. I set the RadSchedulerStringId.NextAppointment and the RadSchedulerStringId.PreviousAppointment to a translated text but they are not used. These two stringids are the only ones which are not used, so i think that these are hardcoded in the RadScheduler.

2. In the Resource ComboBox is a standard empty text ( "None" ) but there is no RadSchedulerStringId to translate it. Is it possible to change this text?

3. In the Appointment Dialog there is not enough space for the translated Text of the AllDayEvent text. Is it possible to extend it ?

4. In the recurring Appointment Dialog there is not enough space for the translated text for many RadSchedulerStringIds. Is it possible to extend it ?

Kind Regards,

Ramius

Boyko Markov
Telerik team
 answered on 30 Nov 2009
1 answer
294 views
Sorry if this is a stupid question but I am going to ask it anyway .
Does the Gridview have the built in ability to use a form for editing/adding a record
or do i have to link another form to the on-click event on the gridview ?

Thanks in advance

Martin 
Jack
Telerik team
 answered on 30 Nov 2009
5 answers
147 views
Hi,
I have problems with RadMenu. I Docked the menu bar in bottom side and i tried changed PopupDirection= Up, but that's not function.
Any help. Please

Victor

Telerik RadControls for WinForms Q3 2009
Windows Vista
Visual Studio 2008
Deyan
Telerik team
 answered on 30 Nov 2009
3 answers
218 views
Hello,

I have a problem with the All Day Appointment view.
I use the Scheduler on a page only for All Day Appointments. On Week view, if a couple appointments are distributed on visible days, they are not aligned to the top of the cell. They align to the top only for the first day of the view. The rest of appointments are shown below the last appointment of the first day of the view.
Can you please tell me how to align all of them to the top?

Thank you.
Boyko Markov
Telerik team
 answered on 30 Nov 2009
0 answers
107 views
Hello,

How can I drag and drop an item from a listbox into the scheduler in the timeslot that is pointed ?

(I can drag and drop an item from the listbox into the scheduler but not in the timeslot that is pointed.)

Regards
Pol Pol
Top achievements
Rank 1
 asked on 30 Nov 2009
2 answers
92 views
Hello,

I have several Drop Down Buttons whose Drop Down Direction was set at Design time to 'Up'. This is no longer being respected at run time. In fact, when handling the DropDownOpening event, I have confirmed that the value is still 'Up', but it is dropping down regardless.

Jeremy
Deyan
Telerik team
 answered on 30 Nov 2009
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
DropDownList
Buttons, RadioButton, CheckBox, etc
ListView
ComboBox and ListBox (obsolete as of Q2 2010)
Form
Chart (obsolete as of Q1 2013)
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
PropertyGrid
Menu
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
Tabstrip (obsolete as of Q2 2010)
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
Wizard
TextBoxControl
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
WaitingBar
GroupBox
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
NavigationView
BindingNavigator
RibbonForm
Styling
Barcode
PopupEditor
TaskBoard
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Overlay
Security
LocalizationProvider
Dictionary
TreeMap
StepProgressBar
SplashScreen
Flyout
Separator
SparkLine
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
SpeechToTextButton
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?