[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework

View a table with headers and footers

Markus E?mayr

9/4/2008 9:24:00 AM

Hello,

I'm currently implementing an application which should display in a table.
But not just a table like a ListView or a DataGrid, the table should have a
footer row too.
That means, there are headers, like the ones the other controls have, below
follow the rows and on the bottom of the table, a footer row is displayed.
The footer row must (like the headers) always be visible, while the rows
between header and footer can be scrolled by the user.

Has anyone of you an idea, how to implement this feature best?

Thanks very much!

Max


1 Answer

Morten Wennevik [C# MVP]

9/5/2008 5:19:00 AM

0


"Markus EÃ?mayr" wrote:

> Hello,
>
> I'm currently implementing an application which should display in a table.
> But not just a table like a ListView or a DataGrid, the table should have a
> footer row too.
> That means, there are headers, like the ones the other controls have, below
> follow the rows and on the bottom of the table, a footer row is displayed.
> The footer row must (like the headers) always be visible, while the rows
> between header and footer can be scrolled by the user.
>
> Has anyone of you an idea, how to implement this feature best?
>
> Thanks very much!
>
> Max
>

Hi Max,

Unfortunately there is no footer support for Windows grids. There may be
third party controls having this feature, but if that isn't an option you
need to simulate the footer in some way or other. If horizontal scrolling
and column resizing isn't needed you can add a set of Labels, TextBoxes or
similar at the bottom of a DataGridView and fill them with the necessary
footer data. If you want scrolling or resizing (or maybe the best visual
effect) then your best option is to add a second DataGridView at the bottom
containing one row and match the scrolling/resizing of the top DataGridView.
You may have to disable the scrollbars in the DataGridViews and add your own
HScrollBar/VScrollBar and scrolling algorithms.

--
Happy Coding!
Morten Wennevik [C# MVP]