Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Deleting columns crashes with null reference exception

FlyGrid.Net (Windows Forms)

.NET Datagrid - Fast, highly customizable, industry standards .NET data grid control for WinForms

This forum related to following products: FlyGrid.Net

Deleting columns crashes with null reference exception
Link Posted: 24-Nov-2006 04:58
Following code crashes in the latest version of FlyGrid with a null reference exception:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using NineRays.Windows.Forms.Grids;

namespace testgrid666 {
  public partial class Form1 : Form {
    public Form1() {
      InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e) {
      flyGrid1.Columns.Items.Add(new Column(\"test1\"));
      flyGrid1.Columns.Items.Add(new Column(\"test2\"));
      flyGrid1.Columns.Items.Add(new Column(\"test3\"));
      flyGrid1.Columns.Items.Add(new Column(\"test4\"));
      flyGrid1.Columns.Items.Add(new Column(\"test5\"));
    }

    private void button1_Click(object sender, EventArgs e) {
      flyGrid1.Columns.Items.RemoveAt(2);
    }
  }
}

Please fix it.
Link Posted: 24-Nov-2006 06:17
Thanks for the code, this problem is already fixed, update will published today.