简体   繁体   中英

Winform DataGridView to UWP Datagrid C#

I was looking to transition from Winforms to UWP. In my first prjoct I need to build a table of data which is dynamic in nature. I have accomplished this with a DataGridView in WinForms very easily by adding columns dynamically and formating the cells according to the cell value.

  AREA1 | CAR10 | CAR 7 | CAR3 |  |
+=======+=======+=======+======+==+
| AREA2 |       |       |      |  |
+-------+-------+-------+------+--+
| AREA3 | CAR5  | CAR1  |      |  |
+-------+-------+-------+------+--+
| AREA4 |       |       |      |  |
+-------+-------+-------+------+--+
| AREA5 | CAR4  |       |      |  |
+-------+-------+-------+------+--+
| AREA6 |       |       |      |  |
+-------+-------+-------+------+--+
| AREA7 | CAR21 | CAR45 |      |  |
+-------+-------+-------+------+--+
| AREA8 |       |       |      |  |
+-------+-------+-------+------+--+
|       |       |       |etc..      |  |
+-------+-------+-------+--

It's very inportant to be able to format the cells accoring to the underly objects properties. I have been looking at a couple of datagrid controls mainly the Telerik UI for UWP Datagrid but I can not see how you dynamically create the properties and then format the cells. I think it would be easy if it was possible to format the grid in the Code behind of the Xaml but this seems the incorrect way?

UWP Community Toolkit的 DataGrid控件是企业和LOB应用程序的标准和推荐方法,特别是在需要诸如数据结构之类的表时,它具有从单元格编辑到虚拟化再到通过UI或后端编辑每个单元格所需的一切。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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