Hi,
we've got an issue concerning flex-grid's way of handling datasources which contain columns only changing in case but not in text. The problem is easy to reproduce and therefore quit annoying. In fact, we need to display measurement data on a per column base where measurement inputs might be, for example "speed" and "SPEED". Unfortunately, flex grid only displays the last property it encounters. Below, a short example code reproduces the issue nice and smoothly - It results in a grid only showing column "n" but not "N":
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Windows.Forms;
using C1.Win.C1FlexGrid;
namespace WindowsApplication3
{
public class DataModel : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
private double _n1;
private double _n2;
public double N
{
get { return _n1; }
set { _n1 = value; OnPropertyChanged("N"); }
}
public double n
{
get { return _n2; }
set { _n2 = value; OnPropertyChanged("n"); }
}
protected virtual void OnPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
public class Program
{
[STAThread]
public static void Main(string[] args)
{
Form form = new Form();
C1FlexGrid grid = new C1FlexGrid();
grid.Dock = DockStyle.Fill;
BindingSource source = new BindingSource();
source.DataSource = typeof(DataModel);
grid.DataSource = source;
form.Controls.Add(grid);
Application.Run(form);
}
}
}
This issue does not occur when using the .NET 2.0 DataGridView even if using the same BindingSource object.
Thanks for your help in advance!
Ramin
PS: To compile the above source, references to system, system.windows.forms and c1flexgrid are required. You should link against a valid, compiled licenses.licx file.