We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

An unbound column & GridFilterBar?

Thread ID:

Created:

Updated:

Platform:

Replies:

8779 Nov 19,2003 03:03 PM Nov 20,2003 05:57 AM Windows Forms 2
loading
Tags: GridControl
Colin Lamarre
Asked On November 19, 2003 03:03 PM

Hi, I'm having problems with the filter bar when I want to add an unbound column, like a check box in the front. I block the filter on this column with GridFilterBarCreatingColumnHeader and an e.Cancel then I get an error from SetCellInfo of GridModel.cs: "Specified argument was out of the range of valid values." line ~4582 Basically I'm combining the GDBGwithdropgrids and filterbargrid examples. It works fine if every colmn is bound, but when there's an unbound column it gets pretty tricky. It has something to do with styleinfo's... anyway has anyone done this before to show an example? TIA! Colin

Jim Frapper
Replied On November 19, 2003 09:31 PM

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";

Colin Lamarre
Replied On November 20, 2003 05:57 AM

Hi Jim, ok I guess I can go that route. Thanks, Colin

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;