Newbie:Displaying aliases in Datagrid

  • Thread starter Thread starter A. Saidov
  • Start date Start date
A

A. Saidov

hi all,

How to display column aliases instead of real column names???

thx in advance for reply
 
Hi,

Check out
System.Windows.Forms.DataGridTableStyle()

An example of this would be:

Me.dgtPrimaryUser.Format = ""
Me.dgtPrimaryUser.FormatInfo = Nothing
Me.dgtPrimaryUser.HeaderText = "Primary User Coloumn"
Me.dgtPrimaryUser.MappingName = "PrimaryUser"
Me.dgtPrimaryUser.NullText = ""
Me.dgtPrimaryUser.Width = 125

Have a look at the Tabstyles button in the Datagrid Propertys aswell, if you
want it done at design time

Thanks
MCN
 
i mean the names displayed in datagrid, not sql column names

thank you all, i guess now it's okay,
Regards
 
Hi Adriano,

I mis the origianal message in my OE, however I still do not see what you
mean.

Is this a webform or a windowform by the way.

Which names in the datagrid?

I only see headers and cells in the datagrid filled with text.

The only thing I can think about are the style columnames, however that are
datanames which even can used more times.

So explain something more?

Cor
 
Hello Cor,

when I add datagrid from dataform wizard, the grid displays only selected
original column names from sql table, so my question was how to rename them
or how to display other text (alias) in datagrid instead.

I used TableStyle from datagrid properties pane, so now it's okay,

many thanks for your help,

Regards
Adriano
 
Back
Top