Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / October 2004

Tip: Looking for answers? Try searching our database.

Grid problem due to null fields?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
B. Chernick - 13 Oct 2004 04:35 GMT
I've just created a fairly routine grid but I have a problem that seems to be
caused by the query.  The query is a Left outer join consisting of 5 fields
and the last two are frequently Null.  The configuration of the grid is
fairly routine and I've done it like this dozens of times - create an array
of DataGridColumnStyle, configure each column and set it's width and then do
an AddRange to GridColumnsStyle.

The problem is that even though normal widths are set, the columns are not
visible. It's as if the width has gone to zero.   I have not seen nulls do
this before in a grid. Any ideas?
Sijin Joseph - 13 Oct 2004 05:34 GMT
Make sure that the MappingName is set correctly to reflect the type of
data source. Some code would be helpful.

Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph

> I've just created a fairly routine grid but I have a problem that seems to be
> caused by the query.  The query is a Left outer join consisting of 5 fields
[quoted text clipped - 6 lines]
> visible. It's as if the width has gone to zero.   I have not seen nulls do
> this before in a grid. Any ideas?
B. Chernick - 13 Oct 2004 12:53 GMT
What exactly do you mean by 'type of data source?'  I don't see any place to
set incoming data type.

> Make sure that the MappingName is set correctly to reflect the type of
> data source. Some code would be helpful.
[quoted text clipped - 13 lines]
> > visible. It's as if the width has gone to zero.   I have not seen nulls do
> > this before in a grid. Any ideas?
B. Chernick - 13 Oct 2004 14:25 GMT
Hold everything.  I just found the problem and it's not what I expected.

The grid is intended for displaying a Left Outer Join on 2 tables.  In the
mappingname I put the complete name of the field in <tablename>.<fieldname>
format.  Luckily there are no duplicate field names in the join so when I
removed the <tablename>.  , everything worked perfectly.

I'm fine for now but what happens if I need to display identically named
fields from 2 tables in the future?  

> Make sure that the MappingName is set correctly to reflect the type of
> data source. Some code would be helpful.
[quoted text clipped - 13 lines]
> > visible. It's as if the width has gone to zero.   I have not seen nulls do
> > this before in a grid. Any ideas?
Sijin Joseph - 14 Oct 2004 04:39 GMT
You can either use a DataCoulmnMapping to rename your coulmns in the
dataset or rename the fields in the sql query itself.

Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph

> Hold everything.  I just found the problem and it's not what I expected.
>
[quoted text clipped - 23 lines]
>>>visible. It's as if the width has gone to zero.   I have not seen nulls do
>>>this before in a grid. Any ideas?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.