Hello Pana,
This is how I did it.
private void mouseDoubleClick()
{
name= (DSV.Person)gridView1.SelectedItem;
DSV.Person pName = name;
foundName= pName.Name.ToString();
String copyFoundName = foundName;
surName= (DSV.Person)gridView1.SelectedItem;
DSV.Person pSurName= surName;
foundSurName = pSurName.surName.ToString();
String fullName = foundName+ "." + foundSurName;
if (controlName == null || foundName!= controlName)
{
fileLoaded = false;
scheduler.Appointments.Clear();
if (fileLoaded == false)
{
if (File.Exists(path))
{
try
{
using (TextReader reader = new StreamReader(path))
{
AppointmentCalendarImporter importer = new AppointmentCalendarImporter();
IEnumerable<IAppointment> appointments = importer.Import(reader);
foreach (IAppointment app in appointments)
{
scheduler.Appointments.Add(app);
}
fileLoaded = true;
}
}
catch (CalendarParseException ex)
{
MessageBox.Show(ex.Message);
}
}
else
{
MessageBox.Show("There were no appointments found for this user");
}
}
}
else
{
MessageBox.Show("The appointments are already loaded");
}
controlName = copyFoundName;
If you need more explaining, just ask ;-)
Kind regards,
Maarten