Column and Data Formats using BoundColumn

J

J Pett

I am using BoundColumn to create new columns and dynamically add them
to a DataGrid, however I cannot see how to apply simply formatting
(e.g. date formats of "dd/mmm/yyyy" and right aligning the column).
The ItemStyle is read only and DataFormatString doesn't seem to allow
this level of formatting.

I am sure this is simply but the MS Help file is no help at all!

Any suggestions greatly appreciated.
 
C

Cyriacus Darkelf

<asp:BoundColumn DataField="mydate" HeaderText="DATE"
DataFormatString="{0:MM/dd/yyyy}">

<HeaderStyle horizontalalign="Center" width="200px" verticalalign="Top"
/>

<ItemStyle wrap="False" horizontalalign="Right" width="200px"
verticalalign="Middle" />

</asp:BoundColumn>
 

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,813
Members
47,357
Latest member
sitele8746

Latest Threads

Top