Wednesday, May 07, 2025

Breaking News
>> Securing and encrypt View State and Cookies values  >> Page has one or more controls that do not correspond with   >> “The Controls collection cannot be modified because the control contains code blocks”  >> How to fix "Validation(): Element 'xxxx' is not supported  >> How to create a new session in ASP.NET programmatically  >> MySQL Database Backup using mysqldump command    

Editors Picks

Friday, February 25, 2011

Date format in datagrid


Date format in datagrid




<table width="100%" border="0" align="center" cellpadding="3" cellspacing="0">
                                                    <tr>
                                                        <td>
                                                            <div style="overflow: auto; height: 400px;">
                                                                <asp:GridView ID="grdViewGroup" AllowPaging="true" runat="server" AutoGenerateColumns="false"
                                                                    PageSize="10" OnPageIndexChanging="grdViewGroup_PageIndexChanging" OnRowCommand="grdViewGroup_RowCommand"
                                                                    OnRowDeleting="grdViewGroup_RowDeleting" OnRowEditing="grdViewGroup_RowEditing">
                                                                    <Columns>
                                                                        
                                                                        <asp:TemplateField HeaderText="Date Created">
                                                                            <ItemTemplate>
                                                                                <asp:Label ID="lblDate" runat="server" Text='<%#Eval("DateCreated","{0: dd/MM/yyyy}") %>'>asp:Label>
                                                                            ItemTemplate>
                                                                            <ItemStyle HorizontalAlign="center" VerticalAlign="Middle" CssClass="border" />
                                                                            <HeaderStyle Width="17%" HorizontalAlign="center" VerticalAlign="Middle" BackColor="#157AC0"
                                                                                CssClass="white_text" />
                                                                        asp:TemplateField>
                                                                       
                                                                        
                                                                    Columns>
                                                                asp:GridView>
                                                               
                                                            div>
                                                        td>
                                                    tr>
                                                table>

No comments :

Post a Comment

Contact Us

Name

Email *

Message *