【问题标题】:C# Compact Framework editable grid control (DataGrid?)C# Compact Framework 可编辑网格控件(DataGrid?)
【发布时间】:2013-01-05 19:02:04
【问题描述】:

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

CF3.5有这种东西吗?

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

我已经尝试过 DataGrid,但看不到如何使其可由用户编辑或如何添加特定宽度的空列。

【问题讨论】:

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


    【解决方案1】:

    来自Using the DataGrid in the .NET Compact Framework

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

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

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

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

    Designing GUI Applications with Windows Forms

    【讨论】:

    • 我不明白:“...从 DataGrid 控件上的智能标记的快捷菜单中选择生成数据表单。”
    • 智能标记出现在表单的设计器视图中:here's a sample
    • 我看不到那个菜单。我是 Win CE 重要吗?
    【解决方案2】:

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

    Column width of a DataGrid in a Windows Mobile Application

    不知何故,我错过了 DataGrid.TableStyles 属性,该属性允许在设计时编辑列。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-09-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多