Link to home
Start Free TrialLog in
Avatar of ziwez0
ziwez0

asked on

Format Column in Gridview

Morning,

im connecting to a access database and it returns the values fine in my gridview, but im having diffilculty formating the fields

the date column is returned as "11/07/2006 00:00:00" and I just want "11/07/2006"

ive tried:
<asp:BoundField DataField="HDate" HeaderText="Date" DataFormatString="{0:MM/dd/yyyy}"/>
<asp:BoundField DataField="HDate" HeaderText="Date" DataFormatString="{0:d}" />

but still get "11/07/2006 00:00:00"

any ideas?

Also the other column returns a number "7.00200000000001" and I just want to round it up or down "7"

not sure about this one but tried
<asp:BoundField DataField="Free" HeaderText="Free" DataFormatString="{0:g}" />

but still get  "7.00200000000001"

thanks
ASKER CERTIFIED SOLUTION
Avatar of SystemExpert
SystemExpert
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial