Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wieslawsoltes/TreeDataGridEx
TreeDataGridEx is an experimental version of TreeDataGrid for Avalonia with added XAML syntax.
https://github.com/wieslawsoltes/TreeDataGridEx
avalonia avaloniaui datagrid treedatagrid xaml
Last synced: about 2 months ago
JSON representation
TreeDataGridEx is an experimental version of TreeDataGrid for Avalonia with added XAML syntax.
- Host: GitHub
- URL: https://github.com/wieslawsoltes/TreeDataGridEx
- Owner: wieslawsoltes
- License: mit
- Created: 2023-08-09T21:43:07.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-10T12:27:45.000Z (3 months ago)
- Last Synced: 2024-10-30T01:02:43.483Z (about 2 months ago)
- Topics: avalonia, avaloniaui, datagrid, treedatagrid, xaml
- Language: C#
- Homepage:
- Size: 165 KB
- Stars: 39
- Watchers: 4
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.TXT
Awesome Lists containing this project
README
# TreeDataGridEx
[![CI](https://github.com/wieslawsoltes/TreeDataGridEx/actions/workflows/build.yml/badge.svg)](https://github.com/wieslawsoltes/TreeDataGridEx/actions/workflows/build.yml)
[![NuGet](https://img.shields.io/nuget/v/TreeDataGridEx.svg)](https://www.nuget.org/packages/TreeDataGridEx)
[![NuGet](https://img.shields.io/nuget/dt/TreeDataGridEx.svg)](https://www.nuget.org/packages/TreeDataGridEx)**TreeDataGridEx** is an experimental version of [TreeDataGrid](https://github.com/AvaloniaUI/Avalonia.Controls.TreeDataGrid) for [Avalonia](https://github.com/AvaloniaUI/Avalonia) with added XAML syntax.
![image](https://github.com/wieslawsoltes/TreeDataGridEx/assets/2297442/cd6d9484-3707-40a7-b012-e0d58966c406)
## Usage
_**Warning:** Please note that the TreeDataGridEx control uses reflection so it might cause issues when using AOT compilation or trimming._
### NuGet
TreeDataGridEx is delivered as a NuGet package.
You can find the packages here [NuGet](https://www.nuget.org/packages/TreeDataGridEx/) and install the package like this:
`Install-Package TreeDataGridEx`
### Styles
Add styles to `App.axaml`:
```xaml
```
### Columns
Available column types:
- TreeDataGridTemplateColumn
- TreeDataGridTextColumn
- TreeDataGridCheckBoxColumn
- TreeDataGridHierarchicalExpanderColumn### Example: Countries
```xaml
```
### Example: Drag/Drop
```xaml
```
### Example: Setting Columns from Style
To set `Columns` property from Style use `TreeDataGridColumnsTemplate` as `Setter.Value`.
```xaml
<Setter Property="Columns">
<TreeDataGridColumnsTemplate>
<objectModel:ObservableCollection x:TypeArguments="TreeDataGridColumn">
<TreeDataGridCheckBoxColumn Header="*" Binding="{Binding IsSelected}" Width="Auto" x:DataType="local:Country" />
<TreeDataGridTextColumn Header="Country" Binding="{Binding Name}" Width="6*" x:DataType="local:Country" />
<TreeDataGridTextColumn Header="Region" Binding="{Binding Region}" x:DataType="local:Country" />
<TreeDataGridTextColumn Header="Population" Binding="{Binding Population}" Width="3*" x:DataType="local:Country" />
<TreeDataGridTextColumn Header="Area" Binding="{Binding Area}" Width="3*" x:DataType="local:Country" />
<TreeDataGridTextColumn Header="GDP" Binding="{Binding GDP}" Width="3*" x:DataType="local:Country" />
</objectModel:ObservableCollection>
</TreeDataGridColumnsTemplate>
</Setter>
```
## Resources
* [GitHub source code repository.](https://github.com/wieslawsoltes/TreeDataGridEx)
## License
TreeDataGridEx is licensed under the [MIT license](LICENSE.TXT).