SimpleDataGrid 0.8.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
Requires NuGet 4.1.0 or higher.
dotnet add package SimpleDataGrid --version 0.8.0
NuGet\Install-Package SimpleDataGrid -Version 0.8.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SimpleDataGrid" Version="0.8.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SimpleDataGrid" Version="0.8.0" />
<PackageReference Include="SimpleDataGrid" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SimpleDataGrid --version 0.8.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SimpleDataGrid, 0.8.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SimpleDataGrid@0.8.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SimpleDataGrid&version=0.8.0
#tool nuget:?package=SimpleDataGrid&version=0.8.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
<img src="https://github.com/DerekGooding/SimpleInjection/blob/main/Icon.png" width=50 height=50/> SimpleDataGrid
A simple DataGrid for WPF that supports pagination, filtering, and searching.
Features
- Pagination: Easily page through large datasets.
- Filtering: Filter data based on custom criteria.
- Searching: Search for data using strings or wildcards.
Usage
- Install the
SimpleDataGridNuGet package. - Add the
PagedDataGridcontrol to your XAML. - Create a
PagedCollectionand bind it to thePagedSourceproperty of thePagedDataGrid.
<Window x:Class="SimpleDataGrid.Example.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:SimpleDataGrid.Example"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Window.DataContext>
<local:MainViewModel />
</Window.DataContext>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="5">
<TextBox x:Name="SearchTextBox" Width="200" Margin="5" />
<Button Content="Search" Click="SearchButton_Click" Margin="5" />
<CheckBox x:Name="WildcardCheckBox" Content="Use Wildcards" VerticalAlignment="Center" Margin="5" />
</StackPanel>
<local:PersonPagedDataGrid x:Name="PagedDataGrid" Grid.Row="1" PagedSource="{Binding People}" AutoGenerateColumns="True" />
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center">
<Button Content="Previous" Click="PreviousButton_Click" Margin="5" />
<TextBlock Text="{Binding People.CurrentPage}" VerticalAlignment="Center" Margin="5" />
<TextBlock Text="/" VerticalAlignment="Center" />
<TextBlock Text="{Binding People.TotalPages}" VerticalAlignment="Center" Margin="5" />
<Button Content="Next" Click="NextButton_Click" Margin="5" />
</StackPanel>
</Grid>
</Window>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void PreviousButton_Click(object sender, RoutedEventArgs e)
{
var viewModel = (MainViewModel)DataContext;
viewModel.People.PreviousPage();
}
private void NextButton_Click(object sender, RoutedEventArgs e)
{
var viewModel = (MainViewModel)DataContext;
viewModel.People.NextPage();
}
private void SearchButton_Click(object sender, RoutedEventArgs e)
{
var viewModel = (MainViewModel)DataContext;
viewModel.People.SetSearch(p => p.Name, SearchTextBox.Text, WildcardCheckBox.IsChecked == true);
}
}
License
This project is licensed under the MIT License. See the LICENSE file for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0-windows7.0 is compatible. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0-windows7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.