473,666 Members | 2,138 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP/DataGrid/BoundColumn/Data formatting expression fo Date?

Hi All,

who suggest why subj do not affect on displayed result for date?
Nov 19 '05 #1
7 7796
Because you are likely making mistakes.

Eliyahu

"Volodymyr Lozovoy" <vl******@mail. ru> wrote in message
news:e6******** ******@TK2MSFTN GP11.phx.gbl...
Hi All,

who suggest why subj do not affect on displayed result for date?

Nov 19 '05 #2
I think so :)
but where?

Data format expression is {0:d}- short date format "05/06/04" (it is wrote
in help "Properties for Bound Columns"), but date is rendered as May 6 2004.
"Eliyahu Goldin" <re************ *@monarchmed.co m> сообщил/сообщила в
новостях следующее: news:OC******** ******@TK2MSFTN GP14.phx.gbl...
Because you are likely making mistakes.

Eliyahu

"Volodymyr Lozovoy" <vl******@mail. ru> wrote in message
news:e6******** ******@TK2MSFTN GP11.phx.gbl...
Hi All,

who suggest why subj do not affect on displayed result for date?


Nov 19 '05 #3
If you look in the help for BoundColumn.Dat aFormatString, you will find that
D (or d) displays numeric values in decimal format. It shouldn't affect date
fields, which is what you are observing.

You can format dates in code-behind in either ItemDataBound or PreRender
event. Get the cell text, convert it to DateTime and format it back to
string with format expression of your choice.

Eliyahu

"Volodymyr Lozovoy" <vl******@mail. ru> wrote in message
news:O8******** ******@tk2msftn gp13.phx.gbl...
I think so :)
but where?

Data format expression is {0:d}- short date format "05/06/04" (it is wrote
in help "Properties for Bound Columns"), but date is rendered as May 6 2004.

"Eliyahu Goldin" <re************ *@monarchmed.co m> сообщил/сообщила в
новостях следующее: news:OC******** ******@TK2MSFTN GP14.phx.gbl...
Because you are likely making mistakes.

Eliyahu

"Volodymyr Lozovoy" <vl******@mail. ru> wrote in message
news:e6******** ******@TK2MSFTN GP11.phx.gbl...
Hi All,

who suggest why subj do not affect on displayed result for date?



Nov 19 '05 #4
I am newbie in .NET. May be i am wrong.
I agree with you about numeric value, but i have date value.
In the help for Standard DateTime Format Strings "d" is short date pattern.
"Eliyahu Goldin" <re************ *@monarchmed.co m> сообщил/сообщила в
новостях следующее: news:eR******** *****@TK2MSFTNG P14.phx.gbl...
If you look in the help for BoundColumn.Dat aFormatString, you will find
that
D (or d) displays numeric values in decimal format. It shouldn't affect
date
fields, which is what you are observing.

You can format dates in code-behind in either ItemDataBound or PreRender
event. Get the cell text, convert it to DateTime and format it back to
string with format expression of your choice.

Eliyahu

"Volodymyr Lozovoy" <vl******@mail. ru> wrote in message
news:O8******** ******@tk2msftn gp13.phx.gbl...
I think so :)
but where?

Data format expression is {0:d}- short date format "05/06/04" (it is
wrote
in help "Properties for Bound Columns"), but date is rendered as May 6

2004.


"Eliyahu Goldin" <re************ *@monarchmed.co m> сообщил/сообщила в
новостях следующее: news:OC******** ******@TK2MSFTN GP14.phx.gbl...
> Because you are likely making mistakes.
>
> Eliyahu
>
> "Volodymyr Lozovoy" <vl******@mail. ru> wrote in message
> news:e6******** ******@TK2MSFTN GP11.phx.gbl...
>> Hi All,
>>
>> who suggest why subj do not affect on displayed result for date?
>>
>>
>
>



Nov 19 '05 #5
.... even if I use format {0:dd-MM-yy} nothing changes.

"Volodymyr Lozovoy" <vl******@mail. ru> сообщил/сообщила в новостях
следующее: news:eE******** ******@TK2MSFTN GP12.phx.gbl...
I am newbie in .NET. May be i am wrong.
I agree with you about numeric value, but i have date value.
In the help for Standard DateTime Format Strings "d" is short date
pattern.
"Eliyahu Goldin" <re************ *@monarchmed.co m> сообщил/сообщила в
новостях следующее: news:eR******** *****@TK2MSFTNG P14.phx.gbl...
If you look in the help for BoundColumn.Dat aFormatString, you will find
that
D (or d) displays numeric values in decimal format. It shouldn't affect
date
fields, which is what you are observing.

You can format dates in code-behind in either ItemDataBound or PreRender
event. Get the cell text, convert it to DateTime and format it back to
string with format expression of your choice.

Eliyahu

"Volodymyr Lozovoy" <vl******@mail. ru> wrote in message
news:O8******** ******@tk2msftn gp13.phx.gbl...
I think so :)
but where?

Data format expression is {0:d}- short date format "05/06/04" (it is
wrote
in help "Properties for Bound Columns"), but date is rendered as May 6

2004.


"Eliyahu Goldin" <re************ *@monarchmed.co m> сообщил/сообщила в
новостях следующее: news:OC******** ******@TK2MSFTN GP14.phx.gbl...
> Because you are likely making mistakes.
>
> Eliyahu
>
> "Volodymyr Lozovoy" <vl******@mail. ru> wrote in message
> news:e6******** ******@TK2MSFTN GP11.phx.gbl...
>> Hi All,
>>
>> who suggest why subj do not affect on displayed result for date?
>>
>>
>
>



Nov 19 '05 #6
Do i understand right that all data is in text format?

"Eliyahu Goldin" <re************ *@monarchmed.co m> сообщил/сообщила в
новостях следующее: news:eR******** *****@TK2MSFTNG P14.phx.gbl...
If you look in the help for BoundColumn.Dat aFormatString, you will find
that
D (or d) displays numeric values in decimal format. It shouldn't affect
date
fields, which is what you are observing.

You can format dates in code-behind in either ItemDataBound or PreRender
event. Get the cell text, convert it to DateTime and format it back to
string with format expression of your choice.

Eliyahu

"Volodymyr Lozovoy" <vl******@mail. ru> wrote in message
news:O8******** ******@tk2msftn gp13.phx.gbl...
I think so :)
but where?

Data format expression is {0:d}- short date format "05/06/04" (it is
wrote
in help "Properties for Bound Columns"), but date is rendered as May 6

2004.


"Eliyahu Goldin" <re************ *@monarchmed.co m> сообщил/сообщила в
новостях следующее: news:OC******** ******@TK2MSFTN GP14.phx.gbl...
> Because you are likely making mistakes.
>
> Eliyahu
>
> "Volodymyr Lozovoy" <vl******@mail. ru> wrote in message
> news:e6******** ******@TK2MSFTN GP11.phx.gbl...
>> Hi All,
>>
>> who suggest why subj do not affect on displayed result for date?
>>
>>
>
>



Nov 19 '05 #7
Thank you! I found my mistake.

"Eliyahu Goldin" <re************ *@monarchmed.co m> сообщил/сообщила в
новостях следующее: news:eR******** *****@TK2MSFTNG P14.phx.gbl...
If you look in the help for BoundColumn.Dat aFormatString, you will find
that
D (or d) displays numeric values in decimal format. It shouldn't affect
date
fields, which is what you are observing.

You can format dates in code-behind in either ItemDataBound or PreRender
event. Get the cell text, convert it to DateTime and format it back to
string with format expression of your choice.

Eliyahu

"Volodymyr Lozovoy" <vl******@mail. ru> wrote in message
news:O8******** ******@tk2msftn gp13.phx.gbl...
I think so :)
but where?

Data format expression is {0:d}- short date format "05/06/04" (it is
wrote
in help "Properties for Bound Columns"), but date is rendered as May 6

2004.


"Eliyahu Goldin" <re************ *@monarchmed.co m> сообщил/сообщила в
новостях следующее: news:OC******** ******@TK2MSFTN GP14.phx.gbl...
> Because you are likely making mistakes.
>
> Eliyahu
>
> "Volodymyr Lozovoy" <vl******@mail. ru> wrote in message
> news:e6******** ******@TK2MSFTN GP11.phx.gbl...
>> Hi All,
>>
>> who suggest why subj do not affect on displayed result for date?
>>
>>
>
>



Nov 19 '05 #8

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

Similar topics

0
1378
by: Robert Brinson | last post by:
Hello all! I'm running .NET Framework 1.1 using VS.NET 2003. I've got a mystery with a DataGrid. Below is the definition of the DataGrid from my aspx page: </asp:datagrid><asp:datagrid id="dgDetails" Runat="server" Width="100%" Visible="False" AllowSorting="True" CellPadding="1" CellSpacing="0" AutoGenerateColumns="False" OnSortCommand="SortDetails"> <ItemStyle Font-Size="XX-Small" Font-Names="Tahoma"></ItemStyle> <HeaderStyle...
2
1439
by: brian richards | last post by:
The datagrid in my page always looks greyed out. But DataGrid.Enabled is set to true. It's never set to false. Is there any other way enabled may be set to false? Or maybe another reason other than the Enabled property that would cause this? I've included the asp.net code and the C# databind code. Thanks
3
4872
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that the best method? Do you have a sample of how to do this?
1
2216
by: VB Programmer | last post by:
I have a datagrid which is bound to a datatable that I create on the fly. How do I set the width of each column via code? Ex: Column 1 is always 100, Column 2 is always 250, etc... Thanks!
5
2738
by: tshad | last post by:
I have been trying to figure out what the Datagrid is doing to create its formatting. I found that some of my Datagrids have a 3D type of border and sometime it has a straight line. I finally found that it comes down to whether there is a "rules=all" attribute (which gives me just a thin black line). If that attribute is not there, you get a 3D effect. I haven't yet been able to figure out what causes it. Here is the table def that...
4
9622
by: yer darn tootin | last post by:
Does anyone know the sort expression for a column that's data has been returned in the format, eg '07 Jul 05'?? The sort expression {..:"dd mmm yy"} doesn't work ( if the column was returned as '07-Mar-05' the expression {..:dd-MMM-yy} works OK Second question, does anyone know hwo to return a date from SQL server in the format '07-Mar-05', as this would be a workaround. At the moment I'm using CONVERT(varchar(12),columnname,6 ) to...
5
2774
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go to the database to get the next page. Is there a way to use the dataset to allow us to read back and forth in it instead of going back to the database to get it? Thanks,
4
3230
by: hope | last post by:
Hi, How can I format a string field using Data Formatting Expression property in datagrid? For example: format last name from BROWN to Brown. Thanks
0
1655
by: webaccess | last post by:
Hi Friends ..!! I want to use datagrid/dataview control to data in tablular format,also I want to add paging and format the data of table column. Problem is data is coming from API Dom in as XML source. Now to display data i hv use dataset to fetch data.so i m displaying data in datagrid/dataview. Now here comes a problem: Using Datagrid :
0
8356
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8781
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8551
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8640
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6198
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 presenter, Adolph DuprИ who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2771
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1776
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.