Hello all,

I have a datagridview, and I have 2 columns, a comboboxcolumn and a textboxcolumn,Now I want to bind this columns to my Dataset. how do I do this???

Recommended Answers

All 4 Replies

Set gridview.Datasource to your dataset

Set gridview.Datasource to your dataset

Does my columns automatically get binded to each columns in my Dataset?

I did that, but now how do I associate my each dataset column to my datagridview column.

Here is how I am trying this:
DataTable gridtable = cDS.Tables.Add("gridviewtable");
dataGridView1.DataSource = cDS.Tables["gridviewtable"];//gridtable
description.DataPropertyName = "description";
amount.DataPropertyName = "amount";

amount and description are my datagridview columns.

Whatever is in my datgridview columns (text), It should also be in my Dataset table. Am I doing it in a right way??

Thanks a lot

I guess you got it right.

just mark the thread as solved if you got what you want.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.