1

I want a grid control where I can specify the columns and allow the user to edit cell values.

Is there such a thing in CF3.5?

I'd prefer a standard control provided with VS 2008 if possible but I'll use a third party one if I have to.

I've tried DataGrid but can't see how to make it editable by the user or how to add an empty column of a certain width.

cja
  • 9,512
  • 21
  • 75
  • 129

2 Answers2

1

From Using the DataGrid in the .NET Compact Framework:

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.

From How to: Use the DataGrid on the Pocket PC:

Alternatively, you can have Visual Studio generate summary and edit forms automatically by selecting Generate Data Forms from the shortcut menu for the smart tag on a DataGrid control.

There is also some other sample code (VB.NET) here:

Designing GUI Applications with Windows Forms

Alex Filipovici
  • 31,789
  • 6
  • 54
  • 78
  • I don't understand: "... selecting Generate Data Forms from the shortcut menu for the smart tag on a DataGrid control." – cja Jan 22 '13 at 15:05
  • The smart tag appears in the Designer view of the form: [here's a sample](http://assets.devx.com/articlefigs/17242.jpg). – Alex Filipovici Jan 22 '13 at 15:08
  • I don't get that menu. Does it matter that I'm Win CE? – cja Jan 22 '13 at 15:22
1

This explains how to add columns and set their widths in code:

Column width of a DataGrid in a Windows Mobile Application

Somehow I missed the DataGrid.TableStyles property, which allows columns to edited at design time.

Community
  • 1
  • 1
cja
  • 9,512
  • 21
  • 75
  • 129