How to change the item width and height in gridview?

mc 5,531 Reputation points
2022-10-03T05:22:52.85+00:00

246912-qq%E6%88%AA%E5%9B%BE20221003132043.png

<GridView>
<GridView.ItemTemplate>
<DataTemplate>
<Rectangle Color="{x:Bind}" Width="10" Height="10" />
</DateTemplate>
</GirdView.ItemTemplate>
</GridView>

How to remove the blank space I only want to show the color rectangle.

Windows development | Windows App SDK
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2022-10-03T09:02:40.513+00:00

    Hello,

    Welcome to Microsoft Q&A!

    Please try to give the Rectangle a bigger size like 80*80 instead of giving it a small size like 10*10.

    Like this:

    246974-image.png

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.