DataTable dt = new DataTable();dt.Columns.Add("Column1", typeof(String)); // First col is a stringdt.Columns.Add("Column2", typeof(Boolean)); // Second col is a booleanDataRow dr = dt.NewRow();dr["Column1"] = "Data";dr["Column2"] = true;dt.Rows.Add(dr);dataGridView1.DataSource = dt;
AATH:
The AutoGenerateColumns property of DataGrid should set to [AutoGenerateColumns="false"] when creating the dataGrid and customized columns should be define as per the requirement.
aage badho no,das,gyarah,barah
ReplyDelete