简体   繁体   English

如何在UWP中将数据绑定到网格视图中?

[英]How to Bind Data to Grid View in a Row Formate in UWP?

In order to support my application to all devices I am migrating my application from WPF to UWP . 为了支持我的应用程序到所有设备,我将我的应用程序从WPF迁移到UWP Here I am facing one GUI Issue. 在这里,我面临一个GUI问题。 ie,

Please check the attached screen shot of my WPF application. 请检查我的WPF应用程序的附加屏幕截图。 Now I want to develop the same GUI using UWP. 现在我想使用UWP开发相同的GUI。 But not getting exact GUI.Its coming in a different formate. 但没有得到确切的GUI.Its进入一个不同的形式。 Please Help me to get the same Kind of GUI using UWP . 请帮助我使用UWP获得相同类型的GUI。

Here in UWP application I am Using Grid View . 在UWP应用程序中,我正在使用网格视图

在此输入图像描述

I don't think GridView is the control you should be looking for. 我不认为GridView是你应该寻找的控件。 GridViews are used to make a grid of "items". GridViews用于制作“项目”网格。 Your table is more of a list (I guess based on the data) where each row is an item right? 你的表格更像是一个列表(我想基于数据)每行是一个项目对吗?

In that case it's probably better to use a listview 在这种情况下,使用listview可能更好

More info: https://msdn.microsoft.com/en-us/library/windows/apps/hh465465.aspx 更多信息: https//msdn.microsoft.com/en-us/library/windows/apps/hh465465.aspx

Within the listview you can create a datatemplate containing the "columns". 在列表视图中,您可以创建包含“列”的datatemplate。

How was the WPF UI built up, using what controls? 如何使用什么控件构建WPF UI? I'll assume it was a DataGrid. 我假设它是一个DataGrid。 Those are not available in Windows 8 or 10 because they are more focused on touch interaction. 这些在Windows 8或10中不可用,因为它们更专注于触摸交互。 There are some 3rd party libraries available which you could use. 您可以使用一些第三方库。 Here is a link comparing some of the 3rd party solutions: http://liftcodeplay.com/2015/10/24/datagrid-alternatives-in-uwp/ 这是一个比较一些第三方解决方案的链接: http//liftcodeplay.com/2015/10/24/datagrid-alternatives-in-uwp/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM