VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



C#.Net - Easy Way To Add Date Picker Control Into Datagridview.

by Gehan Fernando (47 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: VB.NET
Difficulty: Unknown Difficulty
Originally Published: Fri 29th December 2006
Date Added: Mon 8th February 2021
Rating: (1 Votes)

C#.Net - Easy Way To Add Date Picker Control Into Datagridview.

API Declarations


private int SelRow = 0;
// Cell Height
private int yLoc = 30;
// Point Object
private Point pt;

Rate C#.Net - Easy Way To Add Date Picker Control Into Datagridview.



        {
            InitializeComponent();
            dataGridView1.Rows.Add(30);
            dateTimePicker1.Height = 35;
        }

        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            SelRow = e.RowIndex;
            yLoc = SelRow * dataGridView1.CurrentRow.Height;
            dateTimePicker1.Height = dataGridView1.CurrentRow.Height;
            Point pt = new Point(249, (yLoc= yLoc + 30));
            dateTimePicker1.Location = pt;
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            dataGridView1.Rows[0].Selected = true;
            pt = new Point(249, yLoc);
            dateTimePicker1.Location = pt;
        }

Download this snippet    Add to My Saved Code

C#.Net - Easy Way To Add Date Picker Control Into Datagridview. Comments

No comments have been posted about C#.Net - Easy Way To Add Date Picker Control Into Datagridview.. Why not be the first to post a comment about C#.Net - Easy Way To Add Date Picker Control Into Datagridview..

Post your comment

Subject:
Message:
0/1000 characters