in the database i have certain date as 01/01/1900.now while displaying this in the data grid along with the other columns i would like to display all the dates having value 01/01/1900 as blank.is it possible to do so?if yes then how?
s1986
0
Light Poster
Recommended Answers
Jump to PostUse the ItemDataBound or RowDataBound event of the datagrid. This event is fired right after the item is data bound so you can manipulate the formatting of the item based on the data. Search google : "RowDataBound Custom Formatting"
Jump to PostYou can easily create a function and call it, like below:
<script language="vb" runat="server"> Function ChkDate(ByVal dt As String) As String If dt = "01/01/1900" Then ChkDate = "" Else ChkDate = dt End If End Function </script> <%# ChkDate(Eval("Date")) %>
Jump to PostUsing RowDataBound event helps seperating the markup from the code. In performans terms, they seem equal
All 10 Replies
serkan sendur
821
Postaholic
Banned
SheSaidImaPregy
28
Veteran Poster
serkan sendur
821
Postaholic
Banned
Sulley's Boo
commented:
=')
+5
SheSaidImaPregy
28
Veteran Poster
s1986
0
Light Poster
serkan sendur
821
Postaholic
Banned
SheSaidImaPregy
28
Veteran Poster
s1986
0
Light Poster
SheSaidImaPregy
28
Veteran Poster
s1986
0
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.