0

Hi there,
I have a question in a datagridview in C# desktop application,
In one interface ha have a datagridview which has a textboxcolumn and a calendar control column, what I want to do is when the user is start typing a value in the datagridview text box column the current date shold be displayed in the datagridview calendar column.
I wrote a code but the thing is when the user has finished typing in the datagridview textbox column and press tab only the date will appear in the calendar control column, how can I chage the code so that when the user is typing in the textbox column the date to be displayed in the calendar control column??

private void dgvComm_CurrentCellDirtyStateChanged(object sender, EventArgs e)
        {
           
             int i = dgvComm.CurrentRow.Index;

            if (dgvComm.CurrentCell == null)
                return;

            if ((dgvComm.CurrentCell.Value != null))
            {
                dgvComm.CommitEdit(DataGridViewDataErrorContexts.Commit);
                if (dgvComm.CurrentCell.ColumnIndex == 0)
                {
                    dgvComm[1, i].Value = DateTime.Now.Date;
                }
            }               
       
        }
1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by judithSampathwa
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.