I am new to winforms and I have a datagridview inside a table control.
I am trying to bind it to display data.
DataSet dataSet = new DataSet();
DataTable dataTable = dataSet.Tables.Add("Results");
dataTable.Columns.Add("ID");
dataTable.Columns.Add("Name");
dataTable.Rows.Add("1","Jack");
dataTable.Rows.Add("2","Donna");
dataGridView1.DataSource = dataSet;
I don’t find a dataGridView1.DataBind? So I am wondering how I can achieve this?
Also, I’m trying to figure out how to have the first column of the DataGridView as a checkbox. any pointers would help.
http://hodentekhelp.blogspot.com/2008/07/how-to-bind-dataset-to-datagridview.html
This should help with your databinding
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcheckboxcolumn.aspx
take a look at that for the checkbox column
Here is some sample code