Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
a113c59
Add SelectRowColumn column
dvoituron Apr 26, 2024
81177cd
Including Icons
dvoituron Apr 26, 2024
3e233e2
Update the colum name to SelectColumn and use a EventCallback
dvoituron Apr 26, 2024
ef233bc
Adding TGridItem="Person"
dvoituron Apr 26, 2024
5524506
Add SelectAllChanged
dvoituron Apr 26, 2024
fc2f225
Add a bindable SelectAll property
dvoituron Apr 26, 2024
ac38417
Remove AllSelected demo var
dvoituron Apr 26, 2024
888a78e
Merge branch 'dev' into users/datagrid/multi-select
dvoituron Apr 26, 2024
696923e
Merge branch 'dev' into users/datagrid/multi-select
vnbaaij Apr 26, 2024
4bf3bbf
Add Style
dvoituron Apr 26, 2024
0b38e8c
Fix the sample
dvoituron Apr 26, 2024
f110762
Merge branch 'users/datagrid/multi-select' of github.amrom.workers.dev-perso:micros…
dvoituron Apr 26, 2024
cbfe3c1
Add IconIndeterminate
dvoituron Apr 26, 2024
0b47a07
Replace by IEnumerable
dvoituron Apr 26, 2024
5ed9696
Add DataGridSelectMode.Single
dvoituron Apr 26, 2024
50068f9
Merge branch 'dev' into users/datagrid/multi-select
dvoituron Apr 28, 2024
c8daac0
Separated the SelectedItems and Property / OnSelect (not yet completed)
dvoituron Apr 28, 2024
fc271b7
Update
dvoituron Apr 28, 2024
1b83879
Update the 2 examples
dvoituron Apr 28, 2024
0229a57
Add Titles
dvoituron Apr 28, 2024
489af95
Add OnRowDoubleClick
dvoituron Apr 28, 2024
3c1a8ac
Add Enter key
dvoituron Apr 28, 2024
04881be
Update keys to select/unselect
dvoituron Apr 28, 2024
5c87496
Merge branch 'dev' into users/datagrid/multi-select
dvoituron Apr 28, 2024
d360e7e
Update doc
dvoituron Apr 28, 2024
323f2c3
Add first Unit Test
dvoituron Apr 29, 2024
e275763
Add Unit Tests
dvoituron Apr 29, 2024
56d3a89
Add Unit Tests for Property attribute
dvoituron Apr 29, 2024
4f3e2cc
Merge branch 'dev' into users/datagrid/multi-select
dvoituron Apr 29, 2024
cf19e3f
Add SwitchMultiToSingleSelect
dvoituron Apr 29, 2024
6473d6e
Update the doc
dvoituron Apr 29, 2024
c927720
Update Single Icons and Doc (PR comments)
dvoituron Apr 30, 2024
1ae2d38
Merge branch 'dev' into users/datagrid/multi-select
vnbaaij Apr 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add SwitchMultiToSingleSelect
  • Loading branch information
dvoituron committed Apr 29, 2024
commit cf19e3ff2cb3ed23b69edec1375fbebe7b2005ab
44 changes: 37 additions & 7 deletions tests/Core/DataGrid/FluentDataGridColumSelectTests.razor
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@bind-SelectedItems="@SelectedItems" />
<PropertyColumn Property="@(p => p.Name)" />
</FluentDataGrid>
);
);

cut.Verify();
}
Expand All @@ -33,7 +33,7 @@
@bind-SelectedItems="@SelectedItems" />
<PropertyColumn Property="@(p => p.Name)" />
</FluentDataGrid>
);
);

// Pre-Assert
Assert.Empty(cut.FindAll("svg[row-selected]"));
Expand Down Expand Up @@ -64,7 +64,7 @@
OnSelect="@(e => e.Item.Selected = e.Selected)" />
<PropertyColumn Property="@(p => p.Name)" />
</FluentDataGrid>
);
);

// Pre-Assert
Assert.Empty(cut.FindAll("svg[row-selected]"));
Expand Down Expand Up @@ -94,7 +94,7 @@
@bind-SelectedItems="@SelectedItems" />
<PropertyColumn Property="@(p => p.Name)" />
</FluentDataGrid>
);
);

cut.Verify();
}
Expand All @@ -112,7 +112,7 @@
@bind-SelectedItems="@SelectedItems" />
<PropertyColumn Property="@(p => p.Name)" />
</FluentDataGrid>
);
);

// Pre-Assert
Assert.Empty(cut.FindAll("svg[row-selected]"));
Expand Down Expand Up @@ -149,7 +149,7 @@
OnSelect="@(e => e.Item.Selected = e.Selected)" />
<PropertyColumn Property="@(p => p.Name)" />
</FluentDataGrid>
);
);

// Pre-Assert
Assert.Empty(cut.FindAll("svg[row-selected]"));
Expand Down Expand Up @@ -185,7 +185,7 @@
@bind-SelectedItems="@SelectedItems" />
<PropertyColumn Property="@(p => p.Name)" />
</FluentDataGrid>
);
);

// Pre-Assert
Assert.Empty(cut.FindAll("svg[row-selected]"));
Expand Down Expand Up @@ -237,6 +237,36 @@

}

[Fact]
public void FluentDataGrid_ColumSelect_SwitchMultiToSingleSelect()
{
IEnumerable<Person> selectedItems = new[] { People.ElementAt(1), People.ElementAt(2) };

// Arrange
var cut = Render(
@<FluentDataGrid Items="@People" TGridItem="Person">
<SelectColumn TGridItem="Person"
SelectMode="@DataGridSelectMode.Multiple"
@bind-SelectedItems="@selectedItems" />
<PropertyColumn Property="@(p => p.Name)" />
</FluentDataGrid>
);

// Before the switch
Assert.Equal(2, cut.FindAll("svg[row-selected]").Count);
Assert.Equal(2, selectedItems.Count());

// Act
cut.FindComponent<SelectColumn<Person>>().Instance.SelectMode = DataGridSelectMode.Single;
cut.FindComponent<FluentDataGrid<Person>>().Render();

var x = cut.Markup;

// After the switch
Assert.Single(cut.FindAll("svg[row-selected]"));
Assert.Single(selectedItems);
}

/// <summary>
/// Simulate a click on the DataGrid row number <paramref name="row"/>.
/// </summary>
Expand Down