Question in Datagrid

  • Thread starter sukanya s via .NET 247
  • Start date
J

Jos

sukanya said:
(Type your message here)

--------------------------------
From: sukanya s

Since I want to bind the Datagrid at runtime, I have checked "Create
Columns automatically at Runtime option". But if I do this, the
Header Text of the datagrid appears in the same way as it is stored
in the backend. (All the headers are in Caps). But I want the Header
Text to appear with the first Letter in caps followed by small
letters. I tried using "initcap", but the header text still appears
the same way. Please help me with this.
Thanks in advance.

Something like this (VB code):

Sub DataGrid1_ItemDataBound(sender As Object, e As DataGridItemEventArgs)
If(e.Item.ItemType=ListItemType.Header) Then
Dim cell As TableCell
For Each cell In e.Item.Cells
cell.Text = MyConversionFunction(cell.Text )
Next cell
End If
End Sub
 
E

Eliyahu Goldin

Try formatting the headers in ItemDataBound event.

Eliyahu

(Type your message here)

--------------------------------
From: sukanya s

Since I want to bind the Datagrid at runtime, I have checked "Create Columns
automatically at Runtime option". But if I do this, the Header Text of the
datagrid appears in the same way as it is stored in the backend. (All the
headers are in Caps). But I want the Header Text to appear with the first
Letter in caps followed by small letters. I tried using "initcap", but the
header text still appears the same way. Please help me with this.
Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,818
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top