Format GridView with AutoGenerateColumns=true

G

Guest

I have a gridview which need to filled by various data according to user's
action. I want to format the dynamical displayed data. For example the number
should be right aligned, datetime column using short format, etc.

Anyway to implement it? Can RowDataBound event do it? Sounds I need to know
the binding columns' data source type (?_ and set the format of the gridview
columns according to the type. Is it possible?
 
D

David Wier

You've got to have something there, to be able to format - especially since
you want to have different columns formatted differently - at least you will
need to have boundcolumns, in order to create formatting for each one.

I would think that it might be possible in the rowDatabound event, though
I've never tried it, but you'd need to go by cell number
 
N

nick nkw

I cannot bound the columns though. Sounds I need:

1. Capture the column rendering event
2. Get the bound data column type
 

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
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top