473,769 Members | 6,208 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Invalid OperationExcept ion: No row can be added to a
DataGridView control that does not have columns. Columns must be added
first."

I stepped through the InitializeCompo nent 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 1784
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.Invalid OperationExcept ion: No row can be added to a
DataGridView control that does not have columns. Columns must be added
first."

I stepped through the InitializeCompo nent 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
13356
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 that sort and one row for filtering and the lower one with no header for the data. Only it is very complicated to work this way cause for example when the user click on sort on the upper datagridview I need to sort the lower grid and so on when...
4
10235
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 me to a document that shows how this can be done? Thank you
2
15531
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 = GetFinancesConnString(); string sqlSelect = "select CheckNbr, CheckDate, CheckAmt from Disbursements" ; SqlDataAdapter adapter = new SqlDataAdapter(sqlSelect, connectionString);
0
1426
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 columns/rows of the childdren can be edited like a grid on the parent rows grid. The MS examples all show how to make parent/child data grids appear in separate splitter panels. I would like it to show up kind of like how MSAccess shows data sheets in...
0
1021
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 value based on previous columns values eg. col3 = col1 +col2 Can i set formulas for the columns? Is this possible or am i using the wrong control/component? thanks
0
2506
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 my.
1
4916
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 that has 2 text boxes for a specific goal. then I want to have this control as a column Type of a DataGridView.
3
215
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 the column highlight in yellow. Where the row and column intersect, I'd like the cell to take on a red color. It's synonymous to a grid matrix for many maps... EXA: How many miles from one city to another:
0
5657
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 blank unless they are filled by the user. 2) As soon as the user enters a cell, the dtp control should appear as the editing control of that cell. If there's a value in the cell beforehand, that value is set as the value of the dtp editing control...
0
9587
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10211
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9993
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8870
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.