473,416 Members | 1,837 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,416 software developers and data experts.

grid controls of inherited DataGrid class (myDataGridType) are del

I have been using Visual C#.NET to code a large project having many data
adapters, data sets, datagrids, multiple forms with tab pages, each
containing various controls (mostly label, text boxes, check boxes, date
pickers, combo boxes and datagrids). I have been coding alone on this project
for about a year, and I have experienced many problems which have not been
addressed by various SP's, including the recent SP1 to Framework.NET 1.1,
which seemed to be most promising.

In this message, I ask for help in resolving my problems with datagrids of
my derived type being deleted. I have had to create a derived type, since
Microsoft thought it necessary to prevent access to the scroll bar visibility
(which is necessary to counter ANOTHER bug) as well as the inability to
access the function to highlight a grid row. Of course, in order to do this,
I MUST change code in the InitializeComponent section, where the warining
states "do not modify the contents of this method with the code editor". But
since even the MSDN magazine proposes code samples which do exactly that, I
must follow suit and assume that Microsoft has AT LEAST one retard as one of
their programmers.

Unfortunately, the .NET environment randomly decides to throw away my code.
I am forced to frequently exit the environment, so that I can copy the entire
directory structure as a way of limiting my code loss. And no, I will NOT use
SourceSafe, since it introduces even MORE problems than it prevents!

I cannot believe I am the only fool who decided not to purchase 3rd party
data grid software, but if there are any out there who have yet to comit to
using the packaged MS DataGrid, my advice is DON'T! Spend a few hundred bucks
to get something that works reliably. The packaged DataGrid class is only for
the simplest of uses.

The reader may note some bitterness; for that I am sorry, but I have endured
so much pain from this, that I would purposely avoid meeting any MicroSoft
engineers in order to protect myself from a possible homicide charge.

Compounding the problem is the difficulty I face due to the job being
classified: I cannot post code, I have to access a different computer to get
to the Internet, I cannot discuss much detail regarding purpose, and
downloading and installing updates and service packs require third party
intervention and and approval.

I will post questions regarding other issues in other messages, but will
repeat much of the above background information in each.

Help! I have lost SOOOOO much programming time due to these issues, and I
have deadlines to meet!

Steve
Nov 17 '05 #1
5 2351
While I can understand your frustration when you run across bugs in the
framework, you state initially that you are asking for help in resolving
your problems with the datagrid. However, you don't go into specifics about
what the problems are, nor do you give any information about your code and
what you are trying to do.

I've also seen this copied and pasted in another message. Please do not
do this. Your actual problem is being buried under your rhetoric, which is
going to lead to less people reading, and even less people helping you.

That being said, if you can give some more details about your problems
with the DataGrid, then I'm sure there are a few people here who would be
more than willing to help. You mention something about your derived type
being deleted. Do you mean a derived data grid?

As for changing the contents of the InitializeComponent method, if you
place code in there, and lose it, there is nothing that can be said about
that. That code is pretty much not yours, and belongs to the IDE (when you
edit this code in the IDE). It can do what it wishes with that section of
code.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"sdbranum" <sd******@discussions.microsoft.com> wrote in message
news:10**********************************@microsof t.com...
I have been using Visual C#.NET to code a large project having many data
adapters, data sets, datagrids, multiple forms with tab pages, each
containing various controls (mostly label, text boxes, check boxes, date
pickers, combo boxes and datagrids). I have been coding alone on this
project
for about a year, and I have experienced many problems which have not been
addressed by various SP's, including the recent SP1 to Framework.NET 1.1,
which seemed to be most promising.

In this message, I ask for help in resolving my problems with datagrids of
my derived type being deleted. I have had to create a derived type, since
Microsoft thought it necessary to prevent access to the scroll bar
visibility
(which is necessary to counter ANOTHER bug) as well as the inability to
access the function to highlight a grid row. Of course, in order to do
this,
I MUST change code in the InitializeComponent section, where the warining
states "do not modify the contents of this method with the code editor".
But
since even the MSDN magazine proposes code samples which do exactly that,
I
must follow suit and assume that Microsoft has AT LEAST one retard as one
of
their programmers.

Unfortunately, the .NET environment randomly decides to throw away my
code.
I am forced to frequently exit the environment, so that I can copy the
entire
directory structure as a way of limiting my code loss. And no, I will NOT
use
SourceSafe, since it introduces even MORE problems than it prevents!

I cannot believe I am the only fool who decided not to purchase 3rd party
data grid software, but if there are any out there who have yet to comit
to
using the packaged MS DataGrid, my advice is DON'T! Spend a few hundred
bucks
to get something that works reliably. The packaged DataGrid class is only
for
the simplest of uses.

The reader may note some bitterness; for that I am sorry, but I have
endured
so much pain from this, that I would purposely avoid meeting any MicroSoft
engineers in order to protect myself from a possible homicide charge.

Compounding the problem is the difficulty I face due to the job being
classified: I cannot post code, I have to access a different computer to
get
to the Internet, I cannot discuss much detail regarding purpose, and
downloading and installing updates and service packs require third party
intervention and and approval.

I will post questions regarding other issues in other messages, but will
repeat much of the above background information in each.

Help! I have lost SOOOOO much programming time due to these issues, and I
have deadlines to meet!

Steve

Nov 17 '05 #2
Yes Nicholas, I did cut and paste; and I stated the reason for doing so. Many
of the difficulties I face are related, and I expect that background
information might be helpful: informations such as (1) this is a large
application, (2) many controls on many tab pages on many forms may have
something to do with the problems I have faced, (3) the service pack to
Framework.NET 1.1 did not resolve this or any other problem I mention, (4) I
cannot post code or discuss purpose of the code for reasons stated, (5) I
cannot access the Internet on the developement computer, and (6) every
posited possible solution that involves a download poses its own dificulties.
Now you have stated that providing this background for each message causes
the request for help to be buried under rhetoric, so let me ask you - would
you propose that I NOT provide such information in each message, even though
it may likely be relevent? If so, then you would no doubt offer criticism (as
you already did) that I did not provide enough specifics. That is just great
- deal with everyone you meet with Catch 22's - I really would appreciate
help, but I think I can struggle on without yours.

And you are right that I provided little detail regarding the data grid
problem. Would you propose that I provide extensive detail in the first post?
Of course then, you have already demonstrated your disdain for such detail -
casting it as "rhetoric". There it is again - the Catch 22!

Regarding the InitializeComponent warning. Again your are right! That code
is NOT mine! However, I find it strange that so many MSDN magazine "tips" and
"tricks" cannot be used WITHOUT making such modifcations! So then do you
advise that I not listen to those whom Microsoft has "blessed"? If so, then
what is the point of ANYONE asking for help in this forum?

Granted, some bitterness (I succefully withheld MUCH more!) at MS for
allowing the proposition of modifying code in that magazine against their own
warning otherwise in their own product. That is simply incompetence, and I
believe such bitterness should be overlooked WITHOUT condemnation, but I
could be wrong. Apparently you cannot. Thank you for your demeaning
condemnation for attempting to resolve problems with a MS product without
saintly control of each and every aspect of my anger! Go your own way, and
I'll go mine! May we NEVER meet in person!

"Nicholas Paldino [.NET/C# MVP]" wrote:
While I can understand your frustration when you run across bugs in the
framework, you state initially that you are asking for help in resolving
your problems with the datagrid. However, you don't go into specifics about
what the problems are, nor do you give any information about your code and
what you are trying to do.

I've also seen this copied and pasted in another message. Please do not
do this. Your actual problem is being buried under your rhetoric, which is
going to lead to less people reading, and even less people helping you.

That being said, if you can give some more details about your problems
with the DataGrid, then I'm sure there are a few people here who would be
more than willing to help. You mention something about your derived type
being deleted. Do you mean a derived data grid?

As for changing the contents of the InitializeComponent method, if you
place code in there, and lose it, there is nothing that can be said about
that. That code is pretty much not yours, and belongs to the IDE (when you
edit this code in the IDE). It can do what it wishes with that section of
code.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

Nov 17 '05 #3
You are not giving any relevant details of your project, or your code,
which makes helping you next to impossible. If you can give more detailed
information, it would help tremendously.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"sdbranum" <sd******@discussions.microsoft.com> wrote in message
news:E9**********************************@microsof t.com...
Yes Nicholas, I did cut and paste; and I stated the reason for doing so.
Many
of the difficulties I face are related, and I expect that background
information might be helpful: informations such as (1) this is a large
application, (2) many controls on many tab pages on many forms may have
something to do with the problems I have faced, (3) the service pack to
Framework.NET 1.1 did not resolve this or any other problem I mention, (4)
I
cannot post code or discuss purpose of the code for reasons stated, (5) I
cannot access the Internet on the developement computer, and (6) every
posited possible solution that involves a download poses its own
dificulties.
Now you have stated that providing this background for each message causes
the request for help to be buried under rhetoric, so let me ask you -
would
you propose that I NOT provide such information in each message, even
though
it may likely be relevent? If so, then you would no doubt offer criticism
(as
you already did) that I did not provide enough specifics. That is just
great
- deal with everyone you meet with Catch 22's - I really would appreciate
help, but I think I can struggle on without yours.

And you are right that I provided little detail regarding the data grid
problem. Would you propose that I provide extensive detail in the first
post?
Of course then, you have already demonstrated your disdain for such
detail -
casting it as "rhetoric". There it is again - the Catch 22!

Regarding the InitializeComponent warning. Again your are right! That code
is NOT mine! However, I find it strange that so many MSDN magazine "tips"
and
"tricks" cannot be used WITHOUT making such modifcations! So then do you
advise that I not listen to those whom Microsoft has "blessed"? If so,
then
what is the point of ANYONE asking for help in this forum?

Granted, some bitterness (I succefully withheld MUCH more!) at MS for
allowing the proposition of modifying code in that magazine against their
own
warning otherwise in their own product. That is simply incompetence, and I
believe such bitterness should be overlooked WITHOUT condemnation, but I
could be wrong. Apparently you cannot. Thank you for your demeaning
condemnation for attempting to resolve problems with a MS product without
saintly control of each and every aspect of my anger! Go your own way, and
I'll go mine! May we NEVER meet in person!

"Nicholas Paldino [.NET/C# MVP]" wrote:
While I can understand your frustration when you run across bugs in
the
framework, you state initially that you are asking for help in resolving
your problems with the datagrid. However, you don't go into specifics
about
what the problems are, nor do you give any information about your code
and
what you are trying to do.

I've also seen this copied and pasted in another message. Please do
not
do this. Your actual problem is being buried under your rhetoric, which
is
going to lead to less people reading, and even less people helping you.

That being said, if you can give some more details about your
problems
with the DataGrid, then I'm sure there are a few people here who would be
more than willing to help. You mention something about your derived type
being deleted. Do you mean a derived data grid?

As for changing the contents of the InitializeComponent method, if
you
place code in there, and lose it, there is nothing that can be said about
that. That code is pretty much not yours, and belongs to the IDE (when
you
edit this code in the IDE). It can do what it wishes with that section
of
code.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

Nov 17 '05 #4
"Nicholas Paldino [.NET/C# MVP]" wrote:
You are not giving any relevant details of your project, or your code,
which makes helping you next to impossible. If you can give more detailed
information, it would help tremendously.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com


The various data grid are first created in design view. I try to make all
initial adjustments in the design view as well. Upon satifaction with the
databinding and overall appearance, I go to where the data grid is defined as
follows:
private System.Windows.Forms.DataGrid dgMyDG;
and comment that line out to be replaced as follows:
private MyApp.DgPlus dgMyDG;
Next the first reference as follows:
this.dgMyDG = new System.Windows.Forms.DataGrid( );
is replaced with:
this.dgMyDG = new MyApp.DgPlus( );

Note: Both of the above statements are found within InitilizeComponent, and
I would heed the warning not to modify that code, except such is the only
method proposed by MSDN magazine to access the property
"VertScrollBar.Enabled", which for some reason is inaccessible otherwise. I
do this on the recommendation of an article in MSDN magazine.

The class DgPlus is defined as below, much as proscribed by the magazine.

using System;
namespace MyApp {
public class DgPlus : System.Windows.Forms.DataGrid {
public const int WM_LBUTTONDN = 513; // 0x0201
public const int WM_LBUTTONDN = 514; // 0x0202
public bool codeClick = false;
public DgPlus( ) { }
[System.Runtime.InteropServices.DllImport("user32.d ll")]
static extern bool SendMessage(
IntPtr hWnd, Int32 msg, Int32 wParam, Int32 lParam);
static int MakeLong(int LoWord, int HiWord) {
return (HiWord << 16)|(LoWord & 0xffff);
}
public void ClickRowHeader(int row) {
// get a row to click
System.Drawing.Rectangle rect =- this.GetCellBounds(row, 0);
Int32 lparam = MakeLong(rect.Left - 4, rect.Top + 4);
// inform as to source of this click
codeClick = true;
SendMessage(this.Handle, WM_LBUTTONDN, 0, lparam);
SendMessage(this.Handle, WM_LBUTTONUP, 0, lparam);
// Column ZERO is always a dummy bool column having zero width.
this.CurrentCell = new System.Windows.Forms.DataGridCell(
this.CurrentCell.RowNumber, 0)
codeClick = false;
}
}
}

Hopefully I have typed the above without errors.

My experience seems to indicate that if I never again make a change to the
data grid in Design view, there is not a problem, but if I make a change
which causes the IDE to periodically modify some aspect of the DataGrid
within InitializeComponent(), there is a pretty good chance Visual Studio
will report errors in the Task List window. I can't remember the exact
wording in the Task List window, but it asserts that DgPlus does not exist
within the project. I will try to duplicate this failure on a simple project
and record the exact complaint in a follow up message.

Note: Sometimes I CAN modify the data grid in design view without having
problems, but if it becomes necessary to do so, I always first exit Visual
Studio.NET so that I can copy the entire project off to another disk for
recovery purposes.

Tell me what other specifc information you might need, and I'll try to
provide it.

Steve
Nov 17 '05 #5
Upon creation of a test application, the error condition was reproduced when
setting up and redefining the data grid as explained in the previous post.
The error in this case is explainable, but the message is the same as when it
is not.

After I redefined the data grid to my class as:
private MyApp.DgPlus dg1;
then chnaged the first reference to:
this.dg1 = new MyApp.DgPlus( );
I went back to design view without building the application. The data grids
(I had created two) were gone, and the task list window had statements as
follows:

Could not find type 'MyApp.DgPlus.' Please make sure that the assembly that
contains this type is referenced. If this type is part of your developement
project, make sure the project has been successfully built'.

The same statement is found for the 2nd data grid, and each of the data grid
references produced statements similar to the following:

The variable 'dg1' is either undeclared or was never assigned.

In this case, the application will still build, and the data grids appear at
runtime, but they do not show up in the designer. Though I could live with
this being the case, other times this has occurred, the assignment to a
particular table style was broken, and at other times all my column
definitions through that table style were lost. The designer would not allow
a method of reattaching the table style, and if I tried, it would complain
that the name I gave it already existed. I could set things right in code
view, but if I did not get everything exactly right, when I went back to
design view it would make the same complaints again, and throw out the code I
had just modified, since it was located in InitializeComponent.

I'll try to discover a method of reliably reproducing the above described
failure, then post that as well, since that is what has cost me so much lost
time. In some cases, I had to choose between reverting to my previously saved
version and losing a days worth of additional coding, or keep the project as
it was coded and spend hours setting all the conditions exactly right for
every datagrid in my solution, only to find that I forgot one thing and it
would throw out all the code changes I just made to fix it.
Nov 17 '05 #6

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

Similar topics

0
by: Frnak McKenney | last post by:
I have a (small) multi-table database application which allows edits, print reports, and has two scrolling screen displays which show information merged from multiple tables. I'm having trouble...
12
by: Jim H | last post by:
We ahve a .NET web page that we dynamically create a bunch of DataGrids and add them to a place holder. When the user hits submit we need to go through all of the DataGrids to get some data. We...
1
by: Steve | last post by:
Hi I have a db with 2 tables that I want to bind to a grid depending on a selection in a Dropdownlist Also I want to be able to select a row from the gris to fill some textboxes. The databases...
1
by: GP | last post by:
Hi, I have a requirement for which I need to add a text "Page" before the page numbers of the datagrid. It should look like " Page 1 Page 2 Page 3.......", all these being hyper links. I would...
3
by: Kenneth P | last post by:
Hi, I've planned an app where there's a lot of columns in a table and because of that I'd like to split up the columns when presenting them in a datagrid. I'll give you an example. It's always...
4
by: Girish | last post by:
Im trying to create a grid within a grid programmatically. Ive been successful in doing this but I need the embedded grid to fire its ItemDataBound event so I can handle it. The event does not seem...
6
by: Tejpal Garhwal | last post by:
I have datagrid filled with some data rows. At the run time i want know how many total rows are there in the data grid ? Any idea ? Any Suggestions ? Thanks in advance Tej
1
by: fiaolle | last post by:
Hi The first set of source code is the class for a combobox in a grid, hopefully. In the second set of code we try to use the combobox class, but the grid is empty. I don't understand how this...
2
by: =?Utf-8?B?RGlmZmlkZW50?= | last post by:
Hello All, I have a base usercontrol which has a datagrid and a virtual method to populate the datagrid. I developed a child usercontrol which inherits the base usercontrol and also overrides...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
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...

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.