I have an application that displays league tables for sports leagues. These tables are mainly grids with different columns representing statistics for each team, for example, played, won, won, scored, scored and passed, etc. Thus, the league table has one interesting property: for a given competition we always have the same amount of lines (representing teams). Since WPF controls are not needed, I could probably use ListBox, ListView, ItemsControl directly or even DataGrid. It does not really matter.
However, I want something that I have not been able to achieve: given the size of the table (in practice, the size of the window), ALL commands should be visible at any time (without vertical scrolling), all statistics are columns (at the user's choice ) should be visible, and the font size should reflect this so that it is as large as possible, without increasing the size of the column for the content.
I can easily use UniformGrid to achieve parts without vertical scrolling. However, adjusting the font size does not look so easy.
There is, of course, a ViewBox that will allow the contents of each table cell to individually evaluate itself as much as possible, but this may lead to ugliness, as in the end you will get a bunch of cells with different sizes.
I do not expect to get an easy answer to this, but if at all possible, I would like to hear about it. In short:
The table should resize the window, always displaying all the data without scrollbars.
The font size should be set to the maximum possible size, which allows each column of each row to display all its contents.
All columns must be sized to the smallest possible size, which allows all content to be displayed, except for one column that "* -size" will contain the remaining space.
So. Any smart ways to do this? :)
source
share