Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Caption of column in datagrid

Status
Not open for further replies.

mrdance

Programmer
Joined
Apr 17, 2001
Messages
308
Location
SE
Below is my code, I can't understand why it says "NAME" when I start the project instead of "Test" as the column name? Why is that?

DataTable dt = new DataTable("main");
DataColumn col1 = new DataColumn();
col1.Caption = "Test";
col1.ColumnName = "NAME";
col1.DataType = typeof(string);
col1.ReadOnly = true;
dt.Columns.Add(col1);
dataGrid1.DataSource = dt;
DataRow drow = dt.NewRow();
drow["NAME"] = "row1";
dt.Rows.Add(drow);

--- neteject.com - Internet Solutions ---
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top