1

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 finding a way to achieve this. Already "googled", no relevant results found, so please give me some little help. I'm coding in C#.

4 Answers 4

0

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

0

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

0

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.

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.