I have a form with an ultradayview control and ultracalendarinfo control. I have bound a datatable to DataBindingsForOwners and a datatable to DataBindingsForAppointments. If have the dayview control 'groupingstyle' set to no grouping, when I try to add an appointment I get the exception error shown below. If I set the groupingstyle to 'OwnerWithinDate', the ultradayview always shows two columns, 'unassigned' and the one owner in the datatable. I just want a simple form, dayview bound to a datatable that is always for the same owner. How can I do this?
'
' owners
.DataSource = Nothing
.KeyMember = "id"
.NameMember = "username"
.EmailAddressMember = "email"
End With
' appointments
.AllDayEventMember = "alldayflag"
.AllPropertiesMember = "allproperties"
.AllPropertiesMemberSerializationMode = Infragistics.Win.UltraWinSchedule.DateSerializationMode.SerializeDatesAsLocalTime
.DescriptionMember = "description"
.EndDateTimeMember = "date_end"
.OwnerKeyMember = "ownerid"
.ReminderEnabledMember = "reminder_enabled"
.ReminderIntervalMember = "reminder_interval"
.StartDateTimeMember = "date_start"
.SubjectMember = "subject"
Me.UltraCalendarInfo1.Owners.UnassignedOwner.Visible = False
************** Exception Text **************System.ArgumentException: Input string was not in a correct format.Couldn't store <> in ownerid Column. Expected type is Int32. ---> System.FormatException: Input string was not in a correct format. at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at System.String.System.IConvertible.ToInt32(IFormatProvider provider) at System.Data.Common.Int32Storage.Set(Int32 record, Object value) at System.Data.DataColumn.set_Item(Int32 record, Object value) --- End of inner exception stack trace --- at System.Data.DataColumn.set_Item(Int32 record, Object value) at System.Data.DataRow.set_Item(DataColumn column, Object value) at System.Data.DataRowView.SetColumnValue(DataColumn column, Object value) at System.Data.DataColumnPropertyDescriptor.SetValue(Object component, Object value) at Infragistics.Win.UltraWinSchedule.AppointmentsCollection.AddAppointmentToDataSource(Appointment appointment) at Infragistics.Win.UltraWinSchedule.AppointmentsCollection.Add(Appointment appointment, Boolean allowCancel) at Infragistics.Win.UltraWinSchedule.AppointmentsCollection.Add(Appointment appointment) at Infragistics.Win.UltraWinSchedule.AppointmentDialog.SaveItem(Boolean closeAfterSave) at Infragistics.Win.UltraWinSchedule.AppointmentDialog.tbmMain_ToolClick(Object sender, ToolClickEventArgs e) at Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.OnToolClick(ToolClickEventArgs e) at Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.FireEvent(ToolbarEventIds id, EventArgs e) at Infragistics.Win.UltraWinToolbars.ToolBase.OnToolClick() at Infragistics.Win.UltraWinToolbars.ButtonToolUIElement.DoClickProcessing(MouseEventArgs e) at Infragistics.Win.UltraWinToolbars.ButtonToolUIElement.OnMouseUp(MouseEventArgs e) at Infragistics.Win.ControlUIElementBase.ProcessMouseUpHelper(Object sender, MouseEventArgs e) at Infragistics.Win.ControlUIElementBase.ProcessMouseUp(Object sender, MouseEventArgs e) at Infragistics.Win.Utilities.ProcessEvent(Control control, ProcessEvent eventToProcess, EventArgs e) at Infragistics.Win.UltraControlBase.OnMouseUp(MouseEventArgs e) at Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea.OnMouseUp(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
The exception is being thrown because the 'ownerid' field is of type int, and OwnerKeyMember expects a string field.
You can switch off multiple owner display by setting UltraDayView.GroupingStyle to 'NoGrouping'.
You can hide the unassigned owner by setting UltraCalendarInfo.Owners.UnassignedOwner.Visible to false.
My first line of code after binding the owners and appointments is 'Me.UltraCalendarInfo1.Owners.UnassignedOwner.Visible = False' yet it continues to show a column for 'unassigned'. I have the groupstyle set to 'OwnerWithinDate'. What else affects the 'unassigned' showing?