DataGridView control possible gc bug?

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
 
G

Guest

I have this exact same problem using VB.NET, However in C# it works fine

any one have the answer????
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top