473,385 Members | 1,796 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

DataGridView control possible gc bug?

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

Apr 30 '06 #1
1 1764
I have this exact same problem using VB.NET, However in C# it works fine

any one have the answer????

"manjub" wrote:
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

May 30 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: milk-jam | last post by:
I'm trying to set my datagridview so that the first row will be left blank and to use it as a filtering filed for the datagridview. Until now I was using 2 datagridview the upper one with a header...
4
by: dm1608 | last post by:
Hello, I have a DataGridView control in VB.NET 2005 that I would like to iterate thru row by row and parse out the individual columns into variables. Can someone provide me example code or direct...
2
by: Steve Richter | last post by:
what is the best way to use DataGridView to view data from large database tables? Where the sql select statement might return millions of rows? string connectionString =...
0
by: RickH | last post by:
Has anyone tried wrapping the DataGridView control itself as a custom Cell/Column control. So that I can have a child DataGridView appear in a column of a parent DataGridView so that the...
0
by: vblin | last post by:
hi, im using visual basic can anyone tell me if it is possible to use the datagridview control as you would the MSflexgrid? I'm trying to use the datagridview control to make a column to display a...
0
by: jeastman - Hotmail | last post by:
Hello world Excuse, not to be written English and it helps me with a translator. I am new programming in C#. I made a control inheriting the DataGridView to be able to add controls done by...
1
by: Ali | last post by:
Hi, I would like to know wether is it possible to have a user control as a DataGridViewColumn? if it is possible how? if it is not what should I do? for example I 've created a user control...
3
by: =?Utf-8?B?VHJlY2l1cw==?= | last post by:
Hello, Newsgroupians: I'm creating a control derived from DataGridView. I'd like the user to click a row and have the row highlight in yellow. I'd then like the user to click a column and have...
0
by: priyamtheone | last post by:
I'm trying to make a datagridview column to act like a datetimepicker column (C#.Net 2005). These are the behaviours that the dgv should have: 1) Initially all the cells of the dtp column should be...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.