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 482617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:06:52+00:00 2026-05-13T01:06:52+00:00

How to show a Time-picker column in DataGridView? I don’t need to pick Date.

  • 0

How to show a Time-picker column in DataGridView?

I don’t need to pick Date. I only need time to be selected.

  • 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-13T01:06:52+00:00Added an answer on May 13, 2026 at 1:06 am

    Actually, there is a better way than creating a custom DataGridView column. What I currently do for my application is when the TIMESTAMP column of my DataGridView is entered, I position a DateTimePicker control directly over the cell. When the user has clicked out of the cell (thus confirming his selection), the DateTimePicker Visible is set to False and the DateTimePicker’s value is put into the cell. By default, the DateTimePicker control Visibility is set to False until I need it. I also use this for ComboBox controls on regular cells where the user cannot enter a custom value and has to use the list of items from the Setup Screen. This technique is great for faking it. I don’t have the code readily available, but it is less code and easier to maintain IMHO.

    The above and following technique was taken from Faking alternative controls within a DataGridView control in Win Forms 2.0

    Edit: Here is the code –

    private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
    {
                if (selectAllToolStripMenuItem.Checked)
                    selectAllToolStripMenuItem.Checked = false;
    
                if (dtPicker.Visible)
                    dtPicker.Visible = false;
    
                if (e.ColumnIndex >= 0)
                {
                    if (dataGridView1.Columns[e.ColumnIndex].Name == "Delete")
                    {
                        if (adminIsLoggedIn)
                        {
                            removeRow(e);
                        }
                        else
                        {
                            MessageBox.Show("You must be logged in as an Administrator in order to change the facility configuration.", "Delete Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                    else if (dataGridView1.Columns[e.ColumnIndex].Name == "TIMESTAMP")
                    {
                        if (adminIsLoggedIn)
                        {
                            setNewCellDate(e);
                        }
                    }
                    .....
                }
                // ---
    

    }

    private void setNewCellDate(DataGridViewCellEventArgs e)
    {
                dtPicker.Size = dataGridView1.CurrentCell.Size;
                dtPicker.Top = dataGridView1.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, true).Top + dataGridView1.Top;
                dtPicker.Left = dataGridView1.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, true).Left + dataGridView1.Left;
                if (!(object.Equals(Convert.ToString(dataGridView1.CurrentCell.Value), "")))
                    dtPicker.Value = Convert.ToDateTime(dataGridView1.CurrentCell.Value);
                dtPicker.Visible = true;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've a HTML page with several Div's that will show the time difference between
Ok time to show my complete lack of knowladge for all things web forms
So the transparent background problem is solved. Now, every time I show the form
I've gotten a request to show a person's local time based on their phone
I have a list of timesheet entries that show a start and stop time.
Developing websites are time-consuming. To improve productivity, I would code a prototype to show
MessageBox.Show has forms like MessageBox.Show( ownerWindow, .... ). What do I gain by assigning
To show, for example.... USER@SID > I thought this was potentially helpful to a
I want to show HTML content inside Flash. Is there some way to do
<a id=lblShowTimings runat=server title='<%# Eval(SHOW_Name) %>' onclick='PopulateTicketDiv(<%#Eval(SHOW_ID) %>)'> <-- this is the problem %#Eval(SHOW_Time)

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.