Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to force datagrid to display DataColumn caption
Message
From
23/12/2006 20:13:50
 
 
To
All
General information
Forum:
ASP.NET
Category:
Forms
Title:
How to force datagrid to display DataColumn caption
Environment versions
Environment:
C# 1.1
Miscellaneous
Thread ID:
01179970
Message ID:
01179970
Views:
147
The following code shows "Column1" as column caption.
Why ?

How to force DataGrid to display "Caption" as column caption ?
using System.Windows.Forms;
using System.Data;
static class Program    {
static void Main()        {
Application.Run(new Frm());
}    }

class Frm : Form {

public Frm() {
DataTable dt = new DataTable();
DataColumn column = new DataColumn();
column.Caption = "Caption";
dt.Columns.Add(column);
DataGrid dg= new DataGrid();
this.Controls.Add(dg);
dg.SetDataBinding(dt, "");
} }
Andrus
Next
Reply
Map
View

Click here to load this message in the networking platform