简体   繁体   English

如何使用 .NET MAUI Preview 7 创建 DataGrid?

[英]How to Create DataGrid with .NET MAUI Preview 7?

I'm working with a .NET MAUI Preview 7 project and I need to create a Table/Datagrid but I see that in the XAML file, there is no tag for "Table","DataGrid" or "DataView".我正在使用 .NET MAUI Preview 7 项目,我需要创建一个表/数据网格,但我看到在 XAML 文件中,没有“表”、“DataGrid”或“DataView”的标签。

I found only "Grid" which is used to divide the form in rows and columns.我发现只有“网格”用于将表格划分为行和列。

What should I use to create a table showing data (DataBinding)?我应该使用什么来创建显示数据的表(DataBinding)?

Thanks谢谢

Assuming that you mean a grid control like Excel, then that is not something you will find in the box for .NET MAUI, not for the preview, but also not for the final version.假设您的意思是像 Excel 这样的网格控件,那么您不会在 .NET MAUI 的框中找到它,不适用于预览,也不适用于最终版本。

Depending on what you want to achieve you might want to reconsider how you are representing your data or consider getting pre-made controls from vendors like Telerik or SyncFusion.根据您想要实现的目标,您可能需要重新考虑如何表示数据或考虑从 Telerik 或 SyncFusion 等供应商处获取预制控件。

Update: Reading this again I might've misunderstood your question, sorry about that.更新:再读一遍我可能误解了你的问题,抱歉。 A control like that won't be available with .NET MAUI, but of course you can create a custom control if that's what you like. .NET MAUI 不会提供这样的控件,但是如果您喜欢,当然可以创建自定义控件。 The Grid probably is a great starting point, but that will only provide the layout with read-only data. Grid可能是一个很好的起点,但这只会为布局提供只读数据。 If you want to extend it beyond that you will have to gain knowledge about how to create custom controls for .NET MAUI如果您想扩展它,您将必须获得有关如何为 .NET MAUI 创建自定义控件的知识

There is an implementation for DataGrid: https://enisn-projects.io/docs/en/uranium/latest/themes/material/components/DataGrid DataGrid 有一个实现: https://enisn-projects.io/docs/en/uranium/latest/themes/material/components/DataGrid

Disclaimer : This implementation is done by me, but it's an open-source project and completely free.免责声明:此实现由我完成,但它是一个开源项目并且完全免费。 There is no benefit to me and it's not self-promotion.对我没有任何好处,也不是自我推销。

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

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