2,856 questions
Sorry. I simply did this with this.datagrid_eqp.BeginEdit();
was added to the last line. I will leave the post without deleting it in case anyone else can find it.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Below is my code. I have implemented a code that moves the currentcell to the last row in the Datagrid and also scrolls it down when the current button is pressed.
But this code only moves the focus, and to edit the last cell, I have to double-click the mouse to enter edit mode.
Is there a way to enter the edit mode when the button is pressed and input a value into the cell without double-clicking the mouse?
private void btn_info_AddRow_Click(object sender, RoutedEventArgs e)
{
this.datagrid_eqp.Focus();
this.datagrid_eqp.SelectedIndex = this.datagrid_eqp.Items.Count - 1;
this.datagrid_eqp.ScrollIntoView(this.datagrid_eqp.Items[this.datagrid_eqp.Items.Count - 1]);
this.datagrid_eqp.CurrentCell = new DataGridCellInfo(datagrid_eqp.Items[this.datagrid_eqp.Items.Count - 1], datagrid_eqp.Columns[0]);
}
Sorry. I simply did this with this.datagrid_eqp.BeginEdit();
was added to the last line. I will leave the post without deleting it in case anyone else can find it.