策略内的DataGrid单元格编辑 [英] Strategies for cell editing inside DataGrid

查看:188
本文介绍了策略内的DataGrid单元格编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找到数据网格解决方案在.NET Compact Framework中,细胞编辑。

I am trying to find solution for DataGrid in .NET Compact Framework, for cell editing.

它甚至有可能修改单元格中默认的DataGrid中的.NET Compact Framework的,在Windows Mobile,以及如何做到这一点?

Is it even possible to edit cell in default DataGrid in .NET Compact Framework in Windows Mobile, and how to do this?

如果这是不可能,什么是另一种解决办法,也许一些其他控制,如果有游离

If it is not possible, what is another solution, maybe some other control if there is free.

推荐答案

没有,你不能。从

在.NET Compact Framework的,你不能直接编辑内容   的数据网格的运行时间。你必须绑定控件,如   文本框,为您的数据源,并使用DataGrid显示和   选择记录。

In the .NET Compact Framework, you cannot directly edit the contents of the DataGrid at run time. You must bind controls, such as a TextBox, to your data source and use the DataGrid to display and select records.

您没有一个紧凑的设备上大量的屏幕空间,因此电池编辑实际上是怪异。一个很好的方法来处理这​​个问题是有一个重新presents实体的行编辑形式。您可以选择一排,然后用按钮或右键菜单来启动一个编辑。你以这种形式打开选中的行/对象。当完成编辑并单击确定您提交更改后的值对象的行再presents ...

You don't have a lot of screen space on a compact device so cell editing would actually be weird. One good way to handle this is to have an editor form that represents entities in the rows. You select a row and then use a button or context menu to initiate an edit. You open the selected row/object in this form. When done editing and clicking OK you commit the changed values to the object that the row represents...

这里是一个很好的文章详细说明我上述的编辑表单的过程。从链接的文章:

Here is a good article detailing the edit form process I described above. From the linked article:

此示例演示技巧使用DataGrid控件   与形式查看和编辑在选择一个记录   DataGrid控件,并增加了新的记录到数据库中。注意,以   用户界面必须提供编辑数据网格值,因为   编辑DataGrid的细胞,不支持在.NET Compact   框架。此示例使用Northwind数据库,它是   与Visual Studio安装。

This example demonstrates techniques for using the DataGrid control with forms for viewing and editing a record that is selected in the DataGrid control, and adding a new record to the database. Note that a user interface must be provided to edit DataGrid values, because editing the DataGrid cells is not supported in the .NET Compact Framework. This example uses the Northwind database, which is installed with Visual Studio.

这篇关于策略内的DataGrid单元格编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆