private void GenerateCell(string sValue, ColumnDefinition colDef, Thickness borders, int row, int col, SolidColorBrush brush) { Border oCell = new Border(); oCell.BorderBrush = Brushes.Black; oCell.BorderThickness = borders; if (brush == null) { oCell.Background = Brushes.White; oCell.SetBackground(HasAlternatingRows, row); } else oCell.Background = brush; oTable.Children.Add(oCell); oCell.Add2Grid(col, row); TextBlock text = new TextBlock(new Run(sValue)); text.TextWrapping = TextWrapping.NoWrap; text.TextTrimming = TextTrimming.CharacterEllipsis; text.Margin = new Thickness(2, 0, 2, 0); //Zeigen text.TextAlignment = colDef.Alignment; oCell.Child = text; }