Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to force datagrid to display DataColumn caption
Message
From
25/12/2006 06:00:33
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
23/12/2006 20:13:50
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
C# 1.1
Miscellaneous
Thread ID:
01179970
Message ID:
01180112
Views:
15
>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,
If everything worked as documented then it'd be easy.
DataColumn column = new DataColumn("Caption");

It uses ColumnName as caption. Use TableStyles and DataGridColumnStyle if you want to change things like that.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform