I have an editable datagrid in wpf, when writing in a cell it puts that same value in the cell that follows, in the same row, but when I have another row the value of my cell in the second row paints it in the cell next from the first row, how can I do to paint the same value on the same row, attached image and code of what I have.
private void cuenta_LostFocus(object sender, RoutedEventArgs e)
{
MaskedTextBox t2 = (MaskedTextBox)e.Source;
string tex2 = t2.Text;
try
{
var row_list = GetDataGridRows(Grd_Detalle_Provision); //metodo para obtener las filas de mi grid detalle_provision
foreach (DataGridRow single_row in row_list) // recorro las filas que tiene el grid
{
if (single_row.IsSelected == true) // si al fila esta seleccionada
{
TextBox t = FindChild<TextBox>(Grd_Detalle_Provision, "txt_nomCuenta"); // busco el texblock llamado txt_cuentaen el grid
t.Text = tex2; // asigno lo que trae mi celda de numero de cuenta al texbox de nombre de la cuenta
}
}
}
catch
{
throw new Exception("Can't get access to DataGridRow");
}
}