Skip to content

Commit

Permalink
Merge pull request #479 from enisn/2.6-datagrid-separator-fix
Browse files Browse the repository at this point in the history
Fix DataGrid separator ColumnSpan
  • Loading branch information
enisn committed Nov 6, 2023
2 parents 55029ce + 9dba6af commit b159161
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/UraniumUI.Material/Controls/DataGrid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private void ItemsSource_CollectionChanged(object sender, NotifyCollectionChange
{
case NotifyCollectionChangedAction.Add:
{
SlideRow(e.NewStartingIndex+1, 2 * e.NewItems.Count);
SlideRow(e.NewStartingIndex + 1, 2 * e.NewItems.Count);

for (int i = 0; i < e.NewItems.Count; i++)
{
Expand Down Expand Up @@ -261,11 +261,7 @@ protected virtual void RemoveRow(int row)
protected virtual void AddSeparator(int row)
{
var line = HorizontalLineFactory() ?? CreateHorizontalLine();

Grid.SetColumnSpan(line, Columns.Count);

_rootGrid.RowDefinitions.Add(new RowDefinition(GridLength.Auto));
_rootGrid.Add(line, 0, row);
_rootGrid.AddWithSpan(line, row, 0, columnSpan: Columns.Count);
}

private void ConfigureGridColumnDefinitions(int columns)
Expand Down

0 comments on commit b159161

Please sign in to comment.