Search code examples
c#visual-studio-2008.net-cf-3.5

C# Compact Framework editable grid control (DataGrid?)


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.


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