gridview does not show up if there is no data

B

Beemer Biker

Cant believe I spent 4 hours trying to figure out why only the first grid in
my new multiview shows up and the other grids are invisible in the other
views I just added. The database tables were not populated except for the
table I had in the first view! INCREDIBLE: All that data I saw during
design, and assumed it came from the database, was just bill gates made up
data that the designer needed so you could see what you were doing.

So who decided that the header, footer, even the grid would not be displayed
if there is no data?

I googled around and found a solution here
http://weblogs.asp.net/bradygaster/archive/2006/10/24/Empty-GridView_2C00_-Invisible-Footer.aspx
simple, but I am not using ObjectDataSource.

I found this, but could not get it to work:
http://dotnetslackers.com/GridView/re-27953_Displaying_GridView_When_No_Data_Exists.aspx

I added the required "usings" and then put that class at the bottom of
"Default.aspx.cs" but the override CreateChildControls never fired. Is
there a simple way to get the grid and its headers to show up?

...TIA..


--
=======================================================================
Beemer Biker joestateson at grandecom dot net
http://TipsForTheComputingImpaired.com
http://ResearchRiders.org Ask about my 99'R1100RT
=======================================================================
 
A

Alvin Bruney [MVP]

I'm pretty sure bill had nothing to do with the implementation. Have you
tried setting the emptydatatext property of the gridview?

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
 
B

Beemer Biker

Alvin Bruney said:
I'm pretty sure bill had nothing to do with the implementation. Have you
tried setting the emptydatatext property of the gridview?

-

I am reading up on that property, thanks. However, it was easy to hit
"insert" in the db manager and add records just for testing. I added
"engineers best guess" and "chop shop scheduleing" for some fields and once
the engineers saw that they decided to acquire some real data and put it
into the db so the presentation would look good.

No, bill probably had nothing to do with the implementation, but there is
probably a microsoft dotnet junkie responsible for all the IE fixes ;-)

-
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------


Beemer Biker said:
Cant believe I spent 4 hours trying to figure out why only the first grid
in
my new multiview shows up and the other grids are invisible in the other
views I just added. The database tables were not populated except for
the
table I had in the first view! INCREDIBLE: All that data I saw during
design, and assumed it came from the database, was just bill gates made
up
data that the designer needed so you could see what you were doing.

So who decided that the header, footer, even the grid would not be
displayed
if there is no data?

I googled around and found a solution here
http://weblogs.asp.net/bradygaster/archive/2006/10/24/Empty-GridView_2C00_-Invisible-Footer.aspx
simple, but I am not using ObjectDataSource.

I found this, but could not get it to work:
http://dotnetslackers.com/GridView/re-27953_Displaying_GridView_When_No_Data_Exists.aspx

I added the required "usings" and then put that class at the bottom of
"Default.aspx.cs" but the override CreateChildControls never fired. Is
there a simple way to get the grid and its headers to show up?

..TIA..


--
=======================================================================
Beemer Biker joestateson at grandecom dot net
http://TipsForTheComputingImpaired.com
http://ResearchRiders.org Ask about my 99'R1100RT
=======================================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top