N
None
hi there,
i am having a problem about how to filter and hide some of the
appointments in a datagrid. i am working on a wm5 calendar application
using c# 2005 and cf2.0. i built a datagrid with:
private AppointmentCollection apptcollection;
apptcollection = outlooksession.Appointments.Items;
dgrid.datasource = apptcollection;
everything seems fine as i can use the Restrict method to filter the
appointments that i want to display. however, the Restrict method
cannot handle criterion which is a bit more complicated, e.g.
Appointment.Location contains (not equals to) "Office". i guess what i
need to do is looping through the restricted apptcollection, and hide
or remove the rows that i do not want. i do not want to directly
remove the rows in apptcollection because it really causes the records
to be deleted from the database.
i know a dataview can do what i want, however it does not accept
apptcollection to be its source because apptcollection is not a
datatable, i.e.
DataView firstView = new DataView(apptcollection);
*** compile error ***
Argument '1': cannot convert from
'Microsoft.WindowsMobile.PocketOutlook.AppointmentCollection' to
'System.Data.DataTable'
can anyone tell me what i can do to hide or remove some rows from a
datagrid without affecting the underlying data records?
thanks
batterheadccw
i am having a problem about how to filter and hide some of the
appointments in a datagrid. i am working on a wm5 calendar application
using c# 2005 and cf2.0. i built a datagrid with:
private AppointmentCollection apptcollection;
apptcollection = outlooksession.Appointments.Items;
dgrid.datasource = apptcollection;
everything seems fine as i can use the Restrict method to filter the
appointments that i want to display. however, the Restrict method
cannot handle criterion which is a bit more complicated, e.g.
Appointment.Location contains (not equals to) "Office". i guess what i
need to do is looping through the restricted apptcollection, and hide
or remove the rows that i do not want. i do not want to directly
remove the rows in apptcollection because it really causes the records
to be deleted from the database.
i know a dataview can do what i want, however it does not accept
apptcollection to be its source because apptcollection is not a
datatable, i.e.
DataView firstView = new DataView(apptcollection);
*** compile error ***
Argument '1': cannot convert from
'Microsoft.WindowsMobile.PocketOutlook.AppointmentCollection' to
'System.Data.DataTable'
can anyone tell me what i can do to hide or remove some rows from a
datagrid without affecting the underlying data records?
thanks
batterheadccw