Reputation: 502
I am trying to following along with this SO answer, however I am Visual Studio is complaining about the Datagrid is not supported in a Windows Apps project? Is there an alternative to Datagrid that I could use?
Ultimately I would like to create a grid of buttons that correspond to a MenuItem that is in a List menuLists.
I am new to databinding, so if anyone has better things I should be looking at, please let me know.
<Page
x:Class="App1.Pages.MenuItemsPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App1.Pages"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Page.Resources>
<CollectionViewSource x:Key="MenuItemsCollectionViewSource" Source="{Binding MenuItems}"/>
</Page.Resources>
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<DataGrid Grid.Row ="0" ItemsSource ="{Binding Source = {StaticResource MenuItemsCollectionViewSource}}" />
</Grid>
</Page>
Upvotes: 0
Views: 1278
Reputation: 1373
Same problem solved for me when I changed Targer framework
to .NET Framework 4.5
. Originally it was NET Framework 3
. It can be changed in project properties.
Upvotes: 2
Reputation: 235
There is no control. There may be third party controls, or you can get similar layouts by templating a ListView.
Upvotes: 0
Reputation: 502
I figured it out. I'm supposed to use GridView instead when I'm working on Pages.
Upvotes: 1