[Mono-bugs] [Bug 485278] DataGridView: Accessing OwningColumn Property of a cell from OnRowStateChanged event handler crashed on mono

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Mar 13 15:20:17 EDT 2009


https://bugzilla.novell.com/show_bug.cgi?id=485278

User tom_hindle at sil.org added comment
https://bugzilla.novell.com/show_bug.cgi?id=485278#c2





--- Comment #2 from tom hindle <tom_hindle at sil.org>  2009-03-13 13:20:16 MST ---
Better sample code showing accessing OwningColumn property problem.

I will submit unit test patch for this:

using System;
using System.Drawing;
using System.Windows.Forms;

public class MyDataGridViewColumn : DataGridViewColumn
{
    public MyDataGridViewColumn() : base(new MyDataGridViewCell())
    {

    }
}

public class MyDataGridViewCell : DataGridViewCell
{
    public MyDataGridViewCell()
    {        
    }

    protected override void OnDataGridViewChanged()
    {                
        Console.WriteLine("Owning Column = {0}", OwningColumn);
    }

}

public class OwningColumn
{
    [STAThreadAttribute()]
    static void Main()
    {                
        DataGridView dgv = new DataGridView();
        MyDataGridViewColumn column = new MyDataGridViewColumn();
        dgv.Columns.Add(column);        
        dgv.RowCount = 1;                
    }
}

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list