Monday, September 14, 2015
How To Display Only Date in Repeater in Asp.net
In this data repeater column you can put like this <%# Eval("REQ_DATE", "{0:d}")%>
Note : REQ_DATE is Column Name
<asp:Repeater ID="rp_MedAffAproval" runat="server" OnItemDataBound="Repeater_ItemDataBound">
<HeaderTemplate>
<table id="table" cellpadding="1" cellspacing="1" width="98.5%" style="font-family: Calibri;
border: 1px solid #F77D08; background-color: #F77D08; table-layout: fixed;">
<thead>
<tr id="thead" style="background-color: #F77D08; color: Black; width: 98.5%">
<th width="6%">
Req ID
</th>
<th width="28%">
ITEM DESCRIPTION
</th>
<th width="8%">
UNIT
</th>
<th width="10%">
QUANTITY
</th>
<th width="20%">
JUSTIFICATION
</th>
<th width="14%">
REQ DEPARTMENT
</th>
<th width="8%">
REQ DATE
</th>
<th width="12%">
STATUS
</th>
</tr>
</thead>
</HeaderTemplate>
<ItemTemplate>
<tr style="background-color: #E2F2EC" width="98.5%">
<td width="6%">
<a title="Click Here to View" href="#">
<%# Eval("PR_ID")%></a>
</td>
<td width="28%">
<%# Eval("ITEM_DESC")%>
</td>
<td width="8%">
<%# Eval("UNIT")%>
</td>
<td width="10%">
<%# Eval("QTY")%>
</td>
<td width="20%">
<%# Eval("JUSTIFICATION")%>
</td>
<td width="14%">
<%# Eval("REQ_SECTION")%>
</td>
<td width="8%">
<%# Eval("REQ_DATE", "{0:d}")%>
</td>
<td width="12%">
Processing
</td>
</tr>
</ItemTemplate>
<AlternatingItemTemplate>
<tr style="background-color: #FAB16B" width="99.5%">
<td width="6%">
<a title="Click Here to View" href="#">
<%# Eval("PR_ID")%></a>
</td>
<td width="28%">
<%# Eval("ITEM_DESC")%>
</td>
<td width="8%">
<%# Eval("UNIT")%>
</td>
<td width="10%">
<%# Eval("QTY")%>
</td>
<td width="20%">
<%# Eval("JUSTIFICATION")%>
</td>
<td width="14%">
<%# Eval("REQ_SECTION")%>
</td>
<td width="8%">
<%# Eval("REQ_DATE", "{0:d}")%>
</td>
<td width="12%">
Processing
</td>
</tr>
</AlternatingItemTemplate>
<FooterTemplate>
<tr style="background-color: #FFF">
<td colspan="11">
<asp:Label ID="lblEmptyData" Text="No Data To Display" runat="server" Visible="false">
</asp:Label>
</td>
</tr>
</table>
</FooterTemplate>
</asp:Repeater>
Output: