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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

An unbound column & GridFilterBar?

Thread ID:





8779 Nov 19,2003 08:03 PM UTC Nov 20,2003 10:57 AM UTC WinForms 2
Tags: GridControl
Colin Lamarre
Asked On November 19, 2003 08:03 PM UTC

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

Colin Lamarre
Replied On November 20, 2003 10:57 AM UTC

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


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon