JF
Jim Frapper
November 20, 2003 02:31 AM UTC
Hey Colin,
I had this same feature.... Basically making it look like a bit like the listview control eh?! Here is what I did:
Since the filterbar doesn't play well with Dataviews at the moment. I got my datatable, filtered it, sorted it, with a dataview. Then added those records to a datatable such as.
this.filteredAppointments.Columns.Add("Checked",Type.GetType("System.Boolean") );
this.filteredAppointments.Columns.Add("AppointmentTime",Type.GetType("System.String") );
this.filteredAppointments.Columns.Add("AppointmentDate", Type.GetType("System.String"));
this.filteredAppointments.Columns.Add("StartTime",Type.GetType("System.String") );
this.filteredAppointments.Columns.Add("Guest", Type.GetType("System.String"));
this.filteredAppointments.Columns.Add("Student", Type.GetType("System.String"));
this.filteredAppointments.Columns.Add("StudentID", Type.GetType("System.Int32"));
this.filteredAppointments.Columns.Add("AppointmentID", Type.GetType("System.Int32"));
Notice the first column is the only one not in my original dataview.
In order to have it function more like a listview I also made the checkbox column the only column that can be entered and changed. Like so...
this.grdAppointments.Binder.InternalColumns[0].StyleInfo.ReadOnly = false;
this.grdAppointments.Binder.InternalColumns[0].StyleInfo.CellType = "CheckBox";
All other columns:
this.grdAppointments.Binder.InternalColumns[1].StyleInfo.CellType = "Static";
CL
Colin Lamarre
November 20, 2003 10:57 AM UTC
Hi Jim,
ok I guess I can go that route.
Thanks,
Colin