views:

602

answers:

1

Is there a short way to make a FooterTemplate (in a GridView) always visible, even when DataSource is empty?

+1  A: 

If you want it to always display, regardless of content, can't you just put the footer html outside the GridView, instead of in the FooterTemplate?

If that's not an option for some reason, then you can either add an null row to your data source if it's empty, or subclass the GridView & override the default behaviour.

Those are the only options I'm aware of (although its been a while since the last time I used a GridView).

Alconja
I don't really care doing it with with Html, the problem is I want the columns to fit the width of the GridView columns.I want it to show some summarization when data exist, and a insert item (which i implemented in the footer, know what i mean?) when button "New" is pressed on the item template, or show the footer always.in other words:*is there a way to evoke showing the footer (when no data)?*what is actually this null data row thing, didn't getcha (im using EntityDataSource, i think will be more complicated or impossible at all).Thanks buddy.
Shimmy
I don't want to use an empty row, I don't mind subclassing the GridView but no dummy data. 've u got somtn'?
Shimmy
The 2nd link I included (http://mattberseth.com/blog/2007/07/how%5Fto%5Fshow%5Fheader%5Fand%5Ffooter.html) has some example code to allow you to have a grid with a ShowFooterWhenEmpty property.
Alconja