I have created simple mechanism for data table xaml would looks simply:

```
<DataGrid ItemsSource="{Binding CurrentsFlagValuesView}" AutoGenerateColumns="True" />

```

And MVVM code behind is based on data tables, and as well fairly simple:

```
private void GenerateDataView()
{
    CurrentsFlagValuesView = new DataTable();
    CurrentsFlagValuesView.Columns.Add("Bits");

    var bitLength = 0;

    foreach (CurrentsFlagAnalysis flag in CurrentsFlagValues)
    {
        CurrentsFlagValuesView.Columns.Add(flag.DailyCurrentsTimestampInterval.ToString("yyyy-MM-dd"));
        bitLength = flag.CurrentFlagsLength;
    }

    for (var bit = 0; bit < bitLength; bit++)
    {
        List<CurrentFlagEventEnum> flags = CurrentsFlagValues
            .Select(value => value.CurrentFlags.ElementAt(bit))
            .Select(value => value ? (CurrentFlagEventEnum)bit + 1 : CurrentFlagEventEnum.None)
            .ToList();

        var dataRowValues = new List<object> { bit };
        dataRowValues.AddRange(flags.Cast<object>());

        CurrentsFlagValuesView.Rows.Add(dataRowValues.ToArray());
    }
}

```

But I came upon a problem, or two I want to get data of the cell when I click the cell, like Column title, and value of the cell. I managed to do this without MVVM like:

```
void EditingDataGrid_CurrentCellChanged(object sender, EventArgs e)
{
    DataGridCell Cell = EditingDataGrid.GetCurrentDataGridCell();
    var Position = Cell.PointToScreen(new Point(0, 0));

    TextBlock text = (TextBlock)Cell.Content;

    MessageBox.Show("Value=" + text.Text, "Position" );
}

public static DataGridCell GetCurrentDataGridCell(this DataGrid dataGrid)
{
    DataGridCellInfo cellInfo = dataGrid.CurrentCell;
    if (cellInfo.IsValid == false)
    {
        return null;
    }
    var cellContent = cellInfo.Column.GetCellContent(cellInfo.Item);
    if (cellContent == null)
    {
        return null;
    }
    return cellContent.Parent as DataGridCell;
}

```

But now I want to remodel that to that pattern, but I do not know how. Any Ideas how to bind command to that?