views:

2471

answers:

4

I am trying to get a DataGrid under CE 5.0 / .NET CF 2.0 that a user can edit. The document at http://msdn.microsoft.com/en-us/library/ms838165.aspx indicates that some environments do not support editing -

As there is no native support for editing in the DataGrid control, this needs to be implemented manually

Do I need to implement this ugly example - which doesn't work very well as shown?

The documentation is not clear about which .NET features are available on which platform.

+1  A: 

Unfortunately the DataGrid does not support editing. What I do, is use it for displaying read only data and then provide a separate form for editing the selected record.

If you must support editing in a grid layout, then I would look for a third party component.

Petros
+2  A: 

No, it is not directly editable. MSDN has samples for using the DataGrid, including suggestions for data editing, for both Pocket PC and Smartphone devices. Either one would be a reasonable start for a generic CE device, but the general strategy is to determine which cell is active and place a textbox over it for editing capability.

You might also look at Eric Hartwell's extensions for the DataGrid as well as the CF datagrid on CodeProject.

Of course the usual suspects like Resco and ComponentOne also have commercial offerings.

ctacke
Does anyone know if they're planning to put one in for future versions of CF?
Quibblesome
They have no plans to do so that I'm aware of (and I'm pretty close to them). I think their typical MO is to let the market develop one. The frustrating thing is that the control is written in pure C# - I wish they'd just publish the source for the damned thing and let us make it what it should be
ctacke
A: 

Aye, in my opinion its a joke. God knows why they've left it like this since 1.0. On my first ever CF project I assumed it was available and spent an age implementing a read-write one cause i'd put it in the agreed spec.... :(

I learnt a very important lesson that day : Don't expect anything from the FF to be in CF (or rather, check before quoting!).

Quibblesome
+1  A: 

http://msdn.microsoft.com/en-us/library/ms838165.aspx

Guys it can be done..Just follow it..Its so simple when its done ;P..