M
manjub
Hi,
I was working on an MDI application using Visual C++ 2005 .NET. In a
child window, I have an instance of DataGridView control. If I open
several child windows, they all work fine.
However, if I close one of the child windows and try to add a row to
DataGridView control that is active, I get an error
"System.InvalidOperationException: No row can be added to a
DataGridView control that does not have columns. Columns must be added
first."
I stepped through the InitializeComponent function and Columns->Count
at the end of that function is non-zero. No other function is handling
the DataGridView control object. However when the control reaches the
function where a row is added to DataGridView control object,
Columns->Count is miraculously set to 0. I am wondering if the Columns
members are garbage collected though they are still active.
Thanks in advance for your help.
Manju
I was working on an MDI application using Visual C++ 2005 .NET. In a
child window, I have an instance of DataGridView control. If I open
several child windows, they all work fine.
However, if I close one of the child windows and try to add a row to
DataGridView control that is active, I get an error
"System.InvalidOperationException: No row can be added to a
DataGridView control that does not have columns. Columns must be added
first."
I stepped through the InitializeComponent function and Columns->Count
at the end of that function is non-zero. No other function is handling
the DataGridView control object. However when the control reaches the
function where a row is added to DataGridView control object,
Columns->Count is miraculously set to 0. I am wondering if the Columns
members are garbage collected though they are still active.
Thanks in advance for your help.
Manju