Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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.

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

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

The link http://msdn.microsoft.com/en-us/library/ms838165.aspx was really helpful but I think that there is a bug. Instead of

DataTable dataTable = (DataTable)grdOrders.DataSource;
DataView dataView = dataTable.DefaultView;

It should be

DataView dataView = (DataView)itemdataentryGrid.DataSource;
DataTable dataTable = dataView.Table;

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!).

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