I would like to know how to use spellcheck each cell of a datagrid dynamically (not in xaml but in cs) I've already tried something like this, but it doesn't work.
public static void SpellCheck(System.Windows.Controls.DataGrid MyDataGrid)
{
for (int i = 0; i < MyDataGrid.Items.Count; i++)
{
for (int j = 0; j < MyDataGrid.Columns.Count; j++)
{
System.Windows.Controls.TextBox tb = MyDataGrid.GetCell(i, j).Content as System.Windows.Controls.TextBox;
tb.SpellCheck.IsEnabled = true;
}
}
}
This method is called like this
SpellCheck(MyDataGrid);
Can someone help me? Thank you in advance