473,385 Members | 1,409 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,385 software developers and data experts.

How to display empty for DateTime.MinValue in the datagrid

In the Datagrid clolumns there is one is DateTime Type. It always shows
DateTime.MinValue. How can It show emptty string instead? I Know I can do
conversion from DateTime to string before binding the string. Is there a
simple way?
--
Thanks
George Jin
Nov 19 '05 #1
2 3254
George:
Not sure if you'd consider this simple, but I'd hook into the
OnItemDataBound() event of the grid and check the value...

You can find out more here:
http://openmymind.net/index.aspx?documentId=8#4

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"George Jin" <gj****@comcast.net> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
In the Datagrid clolumns there is one is DateTime Type. It always shows
DateTime.MinValue. How can It show emptty string instead? I Know I can do
conversion from DateTime to string before binding the string. Is there a
simple way?
--
Thanks
George Jin

Nov 19 '05 #2
Thanks, that's a way that I don't know before
George

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:e0**************@tk2msftngp13.phx.gbl...
George:
Not sure if you'd consider this simple, but I'd hook into the
OnItemDataBound() event of the grid and check the value...

You can find out more here:
http://openmymind.net/index.aspx?documentId=8#4

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"George Jin" <gj****@comcast.net> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
In the Datagrid clolumns there is one is DateTime Type. It always shows
DateTime.MinValue. How can It show emptty string instead? I Know I can do conversion from DateTime to string before binding the string. Is there a simple way?
--
Thanks
George Jin


Nov 19 '05 #3

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

Similar topics

0
by: Symon R | last post by:
This is a bit of a weird one that I haven't yet been able to solve - I'm hoping someone out there can disprove my findings and tell me where I've gone wrong! I have designed a web service that...
8
by: Gidi | last post by:
hello, i have a textbox that represnts a date and i want to pare it to a DateTime, but sometimes this textBox can be empty string and i want to send it to the DataBase as null or as empty Date, how...
3
by: Hrvoje Voda | last post by:
How to put a dateTime value back to Null! I have a table in database in witch I put a dateTime values. I would like to delete that value so that it becomes null again. Hrcko
3
by: Andrew S. Giles | last post by:
Hello, I am importing a flat text file, and putting it into a datagrid for display on a form. Currently the users have their dates and times seperated. I have two fields, therefore in the...
8
by: craigkenisston | last post by:
I have a generic function that receives a couple of datetime values to work with. They can or cannot have a value, therefore I wanted to use null. This function will call a database stored...
1
by: jib | last post by:
Hi, I've got an ASPX page with a datagrid that has a datetime column. The grid is populated dynamically. Normally the datetime shows just fine, but there is a condition for which no datetime was...
3
by: Paul Say | last post by:
I have a class called Job, that has several properties JobID,Description & StartDate. The StartDate is Property is defined as follows public Class Job private _StartDate as DateTime public...
1
by: David Lozzi | last post by:
Howdy, I am trying to accomplish the following: dim DateSend as date if txtDateSend.text = "" then DateSend = dbnull.value else DateSend = txtDateSend.text
26
by: Neville Lang | last post by:
Hi all, I am having a memory blank at the moment. I have been writing in C# for a number of years and now need to do something in VB.NET, so forgive me such a primitive question. In C#, I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.