Question

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.

Was it helpful?

Solution

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

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top