Why the CurrentCellContainer property is Private???

Jul 17, 2009 at 8:49 AM


I want to get the selected cell text value of datagrid. I can see there is a property named "CurrentCellContainer" in the DataGrid which is private. Why that property is private? Is there anyway to access that value?


Jul 17, 2009 at 1:01 PM

You can use combination of SelectedItem and SelectedIndex properties of DataGrid.

Oct 5, 2009 at 9:28 PM

Can someone post an example of using SelectedItem and SelectedIndex properties of DataGrid to get the value of the CurrentCell?

I see that DataGrid.CurrentCell has .Item (which represents the row as an object) and .Column properties.  I just don't see how to intersect these 2 to get the value of the CurrentCell.


Mar 5, 2013 at 12:37 AM
This is bug for sure.
I have grid with custom datatemplate columns and i cannot get CurrentCellContainer.
SelectedIndex is -1;

dataGridCellInfo.Column.GetCellContent(dataGridCellInfo.Item); is null.

e.AddedCells[0].Item equals {NewItemPlaceholder} object {MS.Internal.NamedObject}

But CurrentCellContainer and FocusedItem set to proper dataCell!