C#Compact Framework可编辑网格控件(DataGrid?)

时间:2013-01-22 14:05:16

标签: c# visual-studio-2008 .net-cf-3.5

我想要一个网格控件,我可以在其中指定列并允许用户编辑单元格值。

CF3.5中有这样的东西吗?

如果可能的话,我更喜欢VS 2008提供的标准控件,但如果必须,我会使用第三方控件。

我已经尝试过DataGrid,但无法看到如何让用户编辑它或如何添加一定宽度的空列。

2 个答案:

答案 0 :(得分:1)

来自Using the DataGrid in the .NET Compact Framework

  

在.NET Compact Framework中,您无法直接编辑内容   在运行时的DataGrid。您必须绑定控件,例如a   TextBox,到您的数据源并使用DataGrid来显示和   选择记录。

来自How to: Use the DataGrid on the Pocket PC

  

或者,您可以让Visual Studio生成摘要和编辑   通过从快捷方式选择生成数据表单自动形成   DataGrid控件上智能标记的菜单。

此处还有一些其他示例代码(VB.NET):

Designing GUI Applications with Windows Forms

答案 1 :(得分:1)

这解释了如何在代码中添加列并设置其宽度:

Column width of a DataGrid in a Windows Mobile Application

不知怎的,我错过了DataGrid.TableStyles属性,它允许在设计时编辑列。