private void ColumnExpression_LostFocus(object sender, RoutedEventArgs e)
        {
            SpreadsheetHeaderExpressionText expressionTextBox = sender as SpreadsheetHeaderExpressionText;
            DataGridColumnHeader            header            = UIHelper.FindVisualParent <DataGridColumnHeader>(sender as FrameworkElement);
            TextBox textBox = UIHelper.FindVisualChild <TextBox>(header);
            int     col     = grid.Columns.IndexOf(header.Column);

            string expression = expressionTextBox.GetExpression();

            data.SetColumnExpression(col, expression);

            expressionTextBox.UpdateDisplay();
            expressionTextBox.Visibility = Visibility.Hidden;
            //textBox.Visibility = Visibility.Visible;
            UpdateColumn(col);
        }
        private void RowExpression_LostFocus(object sender, RoutedEventArgs e)
        {
            SpreadsheetHeaderExpressionText expressionTextBox = sender as SpreadsheetHeaderExpressionText;
            DataGridRowHeader header  = UIHelper.FindVisualParent <DataGridRowHeader>(sender as FrameworkElement);
            DataGridRow       gridRow = UIHelper.FindVisualParent <DataGridRow>(header);
            TextBox           textBox = UIHelper.FindVisualChild <TextBox>(header);
            int row = (gridRow as DataGridRow).GetIndex();

            string expression = expressionTextBox.GetExpression();

            data.SetRowExpression(row, expression);

            expressionTextBox.UpdateDisplay();
            expressionTextBox.Visibility = Visibility.Hidden;
            //textBox.Visibility = Visibility.Visible;
            UpdateRow(row);
        }