Hello,
After much research I still can't figure out how to set the selected value in a resource list. My Resources appear ok, and the correct value is added to the database, but on update, it always selects the 1st data value in the list no matter what the database value. It does not select the "-" unless my data field is null which is correct.
My appointment population loop below.
After much research I still can't figure out how to set the selected value in a resource list. My Resources appear ok, and the correct value is added to the database, but on update, it always selects the 1st data value in the list no matter what the database value. It does not select the "-" unless my data field is null which is correct.
My appointment population loop below.
for (int i = 0; i < appCol.Count; i++) { Appointment apt = new Appointment(); apt.Owner = owner; apt.ID = appCol[i].Id; apt.Start = DateTime.SpecifyKind(Convert.ToDateTime(appCol[i].Start), DateTimeKind.Utc); apt.End = DateTime.SpecifyKind(Convert.ToDateTime(appCol[i].End), DateTimeKind.Utc); apt.RecurrenceRule = Convert.ToString(appCol[i].RecurrenceRule); apt.Description = appCol[i].Description; // load Apppointment Type Resources apt.Resources.AddRange(GetResourcesByType(owner,"Appointment Types")); if (appCol[i].RecurrenceParentId != null) apt.RecurrenceParentID = appCol[i].RecurrenceParentId; int reminderTime = 0; if (Int32.TryParse(appCol[i].Reminder,out reminderTime)) { Reminder r = new Reminder(reminderTime); apt.Reminders.Add(r); Tools.SetAppointmentsForApplication(); } if (apt.RecurrenceParentID != null) { apt.RecurrenceState = RecurrenceState.Exception; } else if (apt.RecurrenceRule != string.Empty) { apt.RecurrenceState = RecurrenceState.Master; } apt.Subject += appCol[i].Subject; appointments.Add(apt); }