C# Windows应用程序项目中不支持Datagrid
我正试图遵循这一点,所以,但我是Visual Studio正在抱怨Windows应用程序项目中不支持Datagrid?我可以使用Datagrid的替代品吗 最后,我想创建一个按钮网格,它对应于列表菜单列表中的菜单项 我是数据绑定新手,所以如果有人有更好的东西我应该看看,请让我知道C# Windows应用程序项目中不支持Datagrid,c#,wpf,xaml,datagrid,C#,Wpf,Xaml,Datagrid,我正试图遵循这一点,所以,但我是Visual Studio正在抱怨Windows应用程序项目中不支持Datagrid?我可以使用Datagrid的替代品吗 最后,我想创建一个按钮网格,它对应于列表菜单列表中的菜单项 我是数据绑定新手,所以如果有人有更好的东西我应该看看,请让我知道 <Page x:Class="App1.Pages.MenuItemsPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/prese
<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>
我想出来了。当我处理页面时,我应该使用GridView。没有控制。可能有第三方控件,或者您可以通过模板化ListView来获得类似的布局。当我将Targer framework
更改为.NET framework 4.5
时,同样的问题也为我解决了。最初它是netframework3
。可以在项目属性中对其进行更改