Skip to content

Commit 74ebfe1

Browse files
committed
readme
1 parent 85e36d4 commit 74ebfe1

File tree

2 files changed

+108
-0
lines changed

2 files changed

+108
-0
lines changed

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
MIT License
3+
4+
Copyright (c) 2025 Derek Gooding
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.

README.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
2+
# SimpleDataGrid
3+
4+
![Icon](Icon.png)
5+
6+
A simple DataGrid for WPF that supports pagination, filtering, and searching.
7+
8+
## Features
9+
10+
* **Pagination:** Easily page through large datasets.
11+
* **Filtering:** Filter data based on custom criteria.
12+
* **Searching:** Search for data using strings or wildcards.
13+
14+
## Usage
15+
16+
1. Install the `SimpleDataGrid` NuGet package.
17+
2. Add the `PagedDataGrid` control to your XAML.
18+
3. Create a `PagedCollection` and bind it to the `PagedSource` property of the `PagedDataGrid`.
19+
20+
```xaml
21+
<Window x:Class="SimpleDataGrid.Example.MainWindow"
22+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
23+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
24+
xmlns:local="clr-namespace:SimpleDataGrid.Example"
25+
mc:Ignorable="d"
26+
Title="MainWindow" Height="450" Width="800">
27+
<Window.DataContext>
28+
<local:MainViewModel />
29+
</Window.DataContext>
30+
<Grid>
31+
<Grid.RowDefinitions>
32+
<RowDefinition Height="Auto" />
33+
<RowDefinition Height="*" />
34+
<RowDefinition Height="Auto" />
35+
</Grid.RowDefinitions>
36+
37+
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="5">
38+
<TextBox x:Name="SearchTextBox" Width="200" Margin="5" />
39+
<Button Content="Search" Click="SearchButton_Click" Margin="5" />
40+
<CheckBox x:Name="WildcardCheckBox" Content="Use Wildcards" VerticalAlignment="Center" Margin="5" />
41+
</StackPanel>
42+
43+
<local:PersonPagedDataGrid x:Name="PagedDataGrid" Grid.Row="1" PagedSource="{Binding People}" AutoGenerateColumns="True" />
44+
45+
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center">
46+
<Button Content="Previous" Click="PreviousButton_Click" Margin="5" />
47+
<TextBlock Text="{Binding People.CurrentPage}" VerticalAlignment="Center" Margin="5" />
48+
<TextBlock Text="/" VerticalAlignment="Center" />
49+
<TextBlock Text="{Binding People.TotalPages}" VerticalAlignment="Center" Margin="5" />
50+
<Button Content="Next" Click="NextButton_Click" Margin="5" />
51+
</StackPanel>
52+
</Grid>
53+
</Window>
54+
```
55+
56+
```csharp
57+
public partial class MainWindow : Window
58+
{
59+
public MainWindow()
60+
{
61+
InitializeComponent();
62+
}
63+
64+
private void PreviousButton_Click(object sender, RoutedEventArgs e)
65+
{
66+
var viewModel = (MainViewModel)DataContext;
67+
viewModel.People.PreviousPage();
68+
}
69+
70+
private void NextButton_Click(object sender, RoutedEventArgs e)
71+
{
72+
var viewModel = (MainViewModel)DataContext;
73+
viewModel.People.NextPage();
74+
}
75+
76+
private void SearchButton_Click(object sender, RoutedEventArgs e)
77+
{
78+
var viewModel = (MainViewModel)DataContext;
79+
viewModel.People.SetSearch(p => p.Name, SearchTextBox.Text, WildcardCheckBox.IsChecked == true);
80+
}
81+
}
82+
```
83+
84+
## License
85+
86+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

0 commit comments

Comments
 (0)