modify the Cell as below:
Getting Column and Row Index:
private void DGR_SUB_INVOLST_BeginningEdit(object sender, DataGridBeginningEditEventArgs e)
{
if (DGR_SUB_INVOLST != null)
{
if (DGR_SUB_INVOLST.Items.Count > 0)
{
OldRowitem = (INVOMonitor)DGR_SUB_INVOLST.CurrentItem;
DataGridColumn col1 = e.Column;
DataGridRow row1 = e.Row;
OldRowindex = ((DataGrid)sender).ItemContainerGenerator.IndexFromContainer(row1);
OldColumnindex = col1.DisplayIndex;
}
}
}
A method to get Cell:
private DataGridCell GetCellVal(string NAME_SUTUN,int ROWINEX)
{
var TheCol = DGR_SUB_INVOLST.Columns.FirstOrDefault(c => c.SortMemberPath == NAME_SUTUN).DisplayIndex;
var DGCInf = new DataGridCellInfo(DGR_SUB_INVOLST.Items[ROWINEX], DGR_SUB_INVOLST.Columns[TheCol]);
var TheDGCell = PublicVRB.GetDataGridCell(DGCInf);
return TheDGCell;
}
use like:
private void DGR_SUB_INVOLST_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
{
if (DGR_SUB_INVOLST != null)
{
if (DGR_SUB_INVOLST.Items.Count > 0)
{
(e.Row.Item as INVOMonitor).CODE = SomeValue;
((TextBlock)GetCellConfig("Binding_Name", row_index).Content).Text = (e.Row.Item as INVOMonitor).CODE.ToString();
}
}
}