in

Flexgrid can't handle datasources properly

Last post 05-12-2008 2:27 AM by C1_SamX. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 05-08-2008 11:51 AM

    • Romout
    • Not Ranked
    • Joined on 05-08-2008
    • Posts 2

    Flexgrid can't handle datasources properly

    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.

     

  • 05-09-2008 10:12 AM In reply to

    • Romout
    • Not Ranked
    • Joined on 05-08-2008
    • Posts 2

    Re: Flexgrid can't handle datasources properly

    No help or ideas at all?
  • 05-12-2008 2:27 AM In reply to

    Re: Flexgrid can't handle datasources properly

    Ramin,

     

    I could replicate the issue as mentioned. To take the issue further I would suggest you to please post your query at support.flexgrid.net@componentone.com.

     

    ~Sam

    <Romout> wrote in message news:204681@10.0.1.98...

    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.

     



    http://helpcentral.componentone.com/cs/forums/p/75198/204681.aspx#204681

Page 1 of 1 (3 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2007 ComponentOne LLC All Rights Reserved.