views:

409

answers:

4

I've been using VS 2005 and VS 2008, and never asked this question, but now I'm having a hard time using controls in VS 2003. A dataGridView does not exist, and I'm forced to use DataGrid control to show some data. The problem is, that I want to edit some of the values displayed by this control, and to reflect those changes in database, and I'm not findin a way to achieve this. Already "googled", no relevant results found, so please give me some little help. I'm coding in C#.

Thanks to everybody in advance.

A: 

There's a reason that DataGrid was replaced with DataGridView... I expect you'll need to find a 3rd-party grid control for 1.1 to do this (but that gets harder the older 1.1 gets).

Sorry if this isn't very helpful...

Marc Gravell
A: 

you can use SqlDataAdapter to fill your DataSet and bind this DataSet to DataGrid and after your changes are made on the DataGrid just call SqlDataAdapter.Update method to update the database

Ahmed Said
A: 

You can use a listview to list the data from database. You can bind the itemsource of listview to a list which you get from DB. Also you can make the listview editable.

If the listview is not sufficient, you can use WindowsFormHost like

 System.Windows.Forms.FlowLayoutPanel advancedFlowLayoutPanel =
                                                this.flowLayoutHost.Child as System.Windows.Forms.FlowLayoutPanel;
            advancedFlowLayoutPanel.WrapContents = true;

Inside it you can place DataGrid.

Sauron
A: 

I got a link from google, as a new user I am not able post it, when you google with 'DataGrid Windows msdn' words the first result have an example make sure that you change the version of the msnd to 1.1 framework.

Hope this helps.

Satish Kumar J