Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to force datagrid to display DataColumn caption
Message
De
25/12/2006 06:00:33
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
23/12/2006 20:13:50
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 1.1
Divers
Thread ID:
01179970
Message ID:
01180112
Vues:
16
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform