473,466 Members | 1,338 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Helpppppppppppp

what is wrong with that code
i only want to replace any Null Value in the DataGrid to a space value
it tells me object not set to an instance
this.DG_U=new System.Windows.Forms.DataGrid();
this.DG_U.TableStyles.AddRange(new
System.Windows.Forms.DataGridTableStyle[] {
this.DG_UTableStyle});
this.DG_UTableStyle.GridColumnStyles.AddRange(new
System.Windows.Forms.DataGridColumnStyle[] {
this.DG_UTextBoxColumn});
the error appears at this point

DG_U.DataSource =DS_U.Tables[0];
DG_U.Size = this.tabPage_U.Size;
this.DG_UTableStyle = new System.Windows.Forms.DataGridTableStyle();
this.DG_UTextBoxColumn = new System.Windows.Forms.DataGridTextBoxColumn();

// DGFaculities
this.DG_UTextBoxColumn.NullText =" ";
this.DG_UTableStyle.DataGrid = this.DG_U;

when i try to make instance of
this.DG_UColumnStyle = new System.Windows.Forms.DataGridColumnStyle();
it tells me it's an abstract class & cant creat instance of it
how to make ittttttttttt

Regards
Nov 16 '05 #1
5 1249
tota wrote:
when i try to make instance of
this.DG_UColumnStyle = new System.Windows.Forms.DataGridColumnStyle();
it tells me it's an abstract class & cant creat instance of it

The answer is in your question. DataGridColumnStyle is an abstract
class. An abstract calls is a class that contains one or more abstract
methods, and therefore can never be instantiated. Abstract classes are
defined so that other classes can extend them and make them concrete by
implementing the abstract methods.

There are two classes in the System.Windows.Forms namespace that extend
this class; DataGridBoolColumn and DataGridTextBoxColumn.

Anders Norås
http://dotnetjunkies.com/weblog/anoras/
Nov 16 '05 #2
tota wrote:
when i try to make instance of
this.DG_UColumnStyle = new System.Windows.Forms.DataGridColumnStyle();
it tells me it's an abstract class & cant creat instance of it

The answer is in your question. DataGridColumnStyle is an abstract
class. An abstract calls is a class that contains one or more abstract
methods, and therefore can never be instantiated. Abstract classes are
defined so that other classes can extend them and make them concrete by
implementing the abstract methods.

There are two classes in the System.Windows.Forms namespace that extend
this class; DataGridBoolColumn and DataGridTextBoxColumn.

Anders Norås
http://dotnetjunkies.com/weblog/anoras/
Nov 16 '05 #3
Tota,

I see a lot code however,

Basicly you only need to contruct a DatagridTableStyle
Add to that a constructed DataGridTextBoxColumn
Set the Mappingname of the DataGridTableStyle to the datatablename
Set the Mappingname of the DataGridTextBoxColumn to the field name
Set the property NullText in the DataGridTextBoxColumn to ""
Add the DatagridTableStyle to your DataGrid.TableStyles

I thought that this should do it.

I hope this helps?

Cor
Nov 16 '05 #4
Tota,

I see a lot code however,

Basicly you only need to contruct a DatagridTableStyle
Add to that a constructed DataGridTextBoxColumn
Set the Mappingname of the DataGridTableStyle to the datatablename
Set the Mappingname of the DataGridTextBoxColumn to the field name
Set the property NullText in the DataGridTextBoxColumn to ""
Add the DatagridTableStyle to your DataGrid.TableStyles

I thought that this should do it.

I hope this helps?

Cor
Nov 16 '05 #5
Also, as an aside, a subject line like "Helppppppp" doesn't garner nearly as
many useful responses as something that actually describes the problem, such
as, "Problem displaying null values in a WinForms DataGrid".

I always cringe at subject lines like that, and usually never read the
message because 95% of the time they are vague questions with insufficient
info to help the person anyway.

--Bob

"tota" <to**@discussions.microsoft.com> wrote in message
news:48**********************************@microsof t.com...
what is wrong with that code
i only want to replace any Null Value in the DataGrid to a space value
it tells me object not set to an instance

Nov 16 '05 #6

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

Similar topics

0
by: tota | last post by:
what is wrong with that code i only want to replace any Null Value in the DataGrid to a space value it tells me object not set to an instance this.DG_U=new System.Windows.Forms.DataGrid(); ...
3
by: Yisehaq | last post by:
Hi guys I am trying to prepare few html pages which contain OLAP cubes on a CD. The problem I have is that the popup blocker blocks the OLAP modules from being shown. Therefore, I wanted to write...
3
by: Vbbeginner07 | last post by:
im doing a payroll project in tat i've inserted a list view control,so i need columns and titles 4 tat,rite nw im a beginner in vb?please helpppppppppppp............
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.