Closed trevordunn closed 8 years ago
Maybe that line should be this? Not entirely sure what the - 5
is trying to accomplish.
ItemWidth = Math.Floor(containerWidth / _columns);
The ResponsiveGridView control is a wrapper of a regular GridView. We need to substract some amount of space to handle the GridView margins. There is another implementation of the ResponsiveGridView control based on the Panel control here. Maybe it works better for you.
Yeah, but the moment a developer changes that margin with styling, this class incorrectly sizes its items. I think it should at least be more dynamic.
Side note: I've noticed that in the recently released UWPCommunity tools there's an AdaptiveGridView that is a copy of this. Should this class even exist in this repo anymore? Probably wouldn't make sense to maintain two (or three if you count the one in labs) of them.
Looks like someone else reported the same issue there. https://github.com/Microsoft/UWPCommunityToolkit/issues/219
@trevordunn are the products waslibs and UWPCommunityToolkit somehow related?
@trevordunn, please use this implementation based on Panel and let me know if you have any issue.
@k0st1x Microsoft recently released UWPCommunityToolkit (see this blog article). I am unclear on their relationship (as I'm not involved in maintaining either repo, nor did the article say anything about this), however the article poster did mention in a comment that "Several of the AppStudio controls has been brought over and cleaned up." when asked "Is this a replacement for app studio?"
@javitosanchez yes, the Labs implementation seems to work better and doesn't have the hardcoded sizing issue.
I could be crazy, but that labs panel will break virtualization on the grid view if that is important to you (which it should be if you have multiple pages of data)
The current implementation doesn't support virtualization. This is one of the reason of being under "labs" section. You can use it if you don't have a big amount of data or you haven't memory restrictions.
Or you can use the other implementation that do supports virtualization.
I'm noticing that all columns have 5px subtracted from what their width should be. I think this is being done here:
https://github.com/wasteam/waslibs/blob/master/src/AppStudio.Uwp/Controls/ResponsiveGridView/ResponsiveGridView.cs#L168
What is the reasoning for this? In one column grids, it leaves 5 blank pixels on the right. With two column grids, 10px...three cols, 15px...etc.