473,408 Members | 2,839 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

DataFormatString

Hi

Im using VB and ASP.NET2.

In DataGrid column is use DataFormatString="{0:dd.MM.yyyy}"
but it's not working :((

for example it displays always also 00:00:00 (houers, minutes and seconds)
too.
and wher i change format to MM/dd/yyyy , date's are displayed dd.MM.yyyy
00:00:00

regioanl settings are Estonian, where dateformat is dd.MM.yyyy.

any ideas?
autogeneratecolumns is off.
Mar 1 '06 #1
3 5450
If you know which column has date,
try this one
datagrid.columns(ColumnNumber).dataformatstring=Cs tr("{0: dd.MM.yyyy}")
"Meelis Lilbok" <me***********@deltmar.ee>, haber iletisinde şunları
yazdı:uL**************@TK2MSFTNGP11.phx.gbl...
Hi

Im using VB and ASP.NET2.

In DataGrid column is use DataFormatString="{0:dd.MM.yyyy}"
but it's not working :((

for example it displays always also 00:00:00 (houers, minutes and seconds)
too.
and wher i change format to MM/dd/yyyy , date's are displayed dd.MM.yyyy
00:00:00

regioanl settings are Estonian, where dateformat is dd.MM.yyyy.

any ideas?
autogeneratecolumns is off.

Mar 1 '06 #2
Meelis,

I had the same problem. And it seems fairly common. The solution is to turn
off HtmlEncoding for the column in question. Just set the HtmlEncode
property of the column in question to false.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Meelis Lilbok" <me***********@deltmar.ee> wrote in message
news:uL**************@TK2MSFTNGP11.phx.gbl...
Hi

Im using VB and ASP.NET2.

In DataGrid column is use DataFormatString="{0:dd.MM.yyyy}"
but it's not working :((

for example it displays always also 00:00:00 (houers, minutes and seconds)
too.
and wher i change format to MM/dd/yyyy , date's are displayed dd.MM.yyyy
00:00:00

regioanl settings are Estonian, where dateformat is dd.MM.yyyy.

any ideas?
autogeneratecolumns is off.

Mar 1 '06 #3
DataFormatString is not good for dates and times. It is intended for
numbers.

You can format dates in either ItemDataBound or PreRender event.

Eliyahu

"Meelis Lilbok" <me***********@deltmar.ee> wrote in message
news:uL**************@TK2MSFTNGP11.phx.gbl...
Hi

Im using VB and ASP.NET2.

In DataGrid column is use DataFormatString="{0:dd.MM.yyyy}"
but it's not working :((

for example it displays always also 00:00:00 (houers, minutes and seconds)
too.
and wher i change format to MM/dd/yyyy , date's are displayed dd.MM.yyyy
00:00:00

regioanl settings are Estonian, where dateformat is dd.MM.yyyy.

any ideas?
autogeneratecolumns is off.

Mar 1 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jac | last post by:
Hey, I do a databinding and use the following <asp:datagrid .....> .... <asp:BoundColumn DataField="f1" HeaderText... DataFormatString="{0:d}">.. This works fine for a date. Now, I have...
1
by: frank | last post by:
I am using the DataFormatString property on BoundColumn objects in a DataGrid, but they don't seem to work for some reason. I copied them straight from another DataGrid where they work fine, but...
9
by: Roy | last post by:
Hey all, Ok, I have a boundcolumn in a datagrid which displays a smalldatetime field from a table. Behold: <asp:BoundColumn DataField="final_appvl_dt" SortExpression="final_appvl_dt"...
0
by: .Net Sports | last post by:
I'm trying to display a figure in my datagrid as a currency ($100.00), but I can't use DataFormatString inside templatecolumn, itemstyle, or itemtemplate (as they imply that no attribute named...
3
by: Gerhard Pretorius | last post by:
Since installing the VS.NET August CTP the DataFormatString of the BoundField in the Gridview does not work. Runtime v2.0.50727. <asp:BoundField DataField="Event_Date"...
1
by: Gerhard Pretorius | last post by:
I am reposting this..hoping someone (from Microsoft) can confirm this at least as a problem: Since installing the VS.NET August CTP the DataFormatString of the BoundField in the Gridview and...
1
by: Randall Parker | last post by:
In ASP.Net v1.1 and C# suppose one has: protected System.Web.UI.WebControls.DataGrid MyGrid; In Page_Load I want to do the equivalent of: MyGrid.Columns.DataFormatString="{0:d}"; or ...
1
by: Hardy Wang | last post by:
Hi, I have a GridView control in my web form (ASP.NET 2.0) <asp:GridView ID="gvReport" runat="server" AllowSorting="True" AutoGenerateColumns="False" Width="100%"> <HeaderStyle...
2
by: Rob Roberts | last post by:
I have a GridView that is bound to a collection of DateTimes (i.e. - Collection<DateTime>). I have a BoundField in the GridView, and its DataField is set to the DateTime's Date property, and the...
5
by: Tim Mackey | last post by:
hi, with a derived DataGrid control, i can override the CreateColumnSet method and scan into the DataGridColumns and set the DataFormatString, e.g. leave out the time part of a DateTime value. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.