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

  • SEARCH
  • Home
  • 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 363159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:18:57+00:00 2026-05-12T13:18:57+00:00

I have a Gridview that has a timestamp as one of the rows. When

  • 0

I have a Gridview that has a timestamp as one of the rows. When I read the data from the database the data is in the format( mm/dd/yyyy hh:mm:ss ). I’ve figured out how to format the way I want it which is just the ( mm/dd/yyyy ) and droping of the (hh:mm:ss) with the following code:

  Dim numrows2 = GridView1.Rows.Count
  For i = 0 To numrows2 - 1
        Dim acc = Left(GridView1.Rows(i).Cells(0).Text, 10)
        GridView1.Rows(i).Cells(0).Text = acc
  Next i

The problem is that this gridview has like 5 pages and this will only work for the current page. For instance,

  1. initial load of the page the 1st page will be formatted correctly
  2. I click page 3, this code will format page 1, so page 3 won’t be formatted
  3. I click page 1, the code will format page 3

So it’s basically formatting the current page, but not the selected page.

I either need to be able to format every row of the gridview everytime, or be able to figure out the page selected and format that page. I don’t know how to do either.

Any help would be appreciated.

  • 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-12T13:18:57+00:00Added an answer on May 12, 2026 at 1:18 pm

    Use formatting in the datacolumn like so:

    <asp:BoundField HeaderText="Date" DataField="SomeDate" DataFormatString="{0:MM/dd/yyyy}">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a gridview that has the ability to select rows. <asp:CommandField ShowSelectButton=true SelectImageUrl=~/Images/Icons/Cross.png
I currently have a gridview that has an asp:ButtonField as one of the columns.
I have a gridview that shows (50)rows of data per page. I have the
I have a gridview that has some 20 columns and 1000 rows. The grid
I have a gridview that has a template field containing a checkbox as one
I have a GridView that has 3 columns: FirstName, LastName and a TemplateField FullName
I have a gridview control that has on onclick event bound to every cell.
I have web forms page that has 2 controls. A gridview and an associated
I have a GridView. My GridView has a column that is contains an Options
For example, Lets say that I have a gridview column which has important controls,

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.