Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6638951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:29:50+00:00 2026-05-25T23:29:50+00:00

I have the following gridview: I need to parse the first 8 elements of

  • 0

I have the following gridview: I need to parse the first 8 elements of the datetime and view these only in the gridview. How can i do that?

 <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"  DataKeyNames="ID" BackColor="White"
                    BorderColor="#336666" BorderStyle="Double" BorderWidth="3px"
                    CellPadding="1" DataSourceID="SqlDataSource1"
                    OnRowDataBound="GridView1_RowDataBound" 
                    OnSelectedIndexChanged="GridView1_SelectedIndexChanged" 
                    GridLines="Horizontal" CellSpacing="4" Height="20px" 
                    Width="842px" ShowFooter="True">
                    <FooterStyle BackColor="White" ForeColor="#333333" />
                    <RowStyle ForeColor="#333333" BackColor="White" />
                    <Columns>
                        <asp:ButtonField CommandName="Select" Visible="false" />
                        <asp:BoundField DataField="ID" HeaderText="ID" HeaderStyle-HorizontalAlign="Left" InsertVisible="False" ReadOnly="True" />
                        <asp:BoundField DataField="title" HeaderStyle-HorizontalAlign="Left" HeaderText="Title"/>    
                        <asp:BoundField DataField="location" HeaderStyle-HorizontalAlign="Left" HeaderText="Location"/>
                        <asp:BoundField DataField="datetime" HeaderStyle-HorizontalAlign="Left" HeaderText="Datetime"/>                                               
                    </Columns>
                    <PagerStyle BackColor="#336666" ForeColor="White" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#339966" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#336666" Font-Bold="True" ForeColor="White" />
                </asp:GridView>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:29:51+00:00Added an answer on May 25, 2026 at 11:29 pm

    Try this:

    <asp:BoundField DataFormatString="{0:MM/dd/yy}" DataField="datetime" HeaderStyle-HorizontalAlign="Left" HeaderText="Datetime" />                                               
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following Gridview: <asp:GridView ID=GridView1 runat=server CssClass=table DataKeyNames=groupId DataSource=<%# dsUserGroupsSelected %> DataMember=Group etc....>
I need to implement the following in the asp.net Gridview. I have the excel
I am working on Gridview in ASP.NET(C#) and have cells that need to have
I have written the following in my gridview i would like to show only
I have a GridView which has following template field that holds the filename, when
Evening all. I have the following code that I need looking into - basically
I have an ASP.NET GridView that's bound to an ObjectDataSource (which is bound to
I have the following GridView : <ListView Name=TrackListView ItemContainerStyle={StaticResource itemstyle}> <ListView.View> <GridView> <GridViewColumn Header=Title
I use the following code to display a tooltip <asp:GridView ID=GridView1 runat=server AutoGenerateColumns=False DataKeyNames=ID
I have the following GridView and ObjectDataSource: <asp:GridView ID=grdTrades runat=server DataSourceID=srcTrades DataKeyNames=tradeId EnablePersistedSelection=true SelectedRowStyle-BackColor=Yellow

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.