![]() |
VOOZH | about |
dotnet add package Krypton.Toolkit.Suite.Extended.TreeGridView.Nightly --version 110.26.5.132-alpha
NuGet\Install-Package Krypton.Toolkit.Suite.Extended.TreeGridView.Nightly -Version 110.26.5.132-alpha
<PackageReference Include="Krypton.Toolkit.Suite.Extended.TreeGridView.Nightly" Version="110.26.5.132-alpha" />
<PackageVersion Include="Krypton.Toolkit.Suite.Extended.TreeGridView.Nightly" Version="110.26.5.132-alpha" />Directory.Packages.props
<PackageReference Include="Krypton.Toolkit.Suite.Extended.TreeGridView.Nightly" />Project file
paket add Krypton.Toolkit.Suite.Extended.TreeGridView.Nightly --version 110.26.5.132-alpha
#r "nuget: Krypton.Toolkit.Suite.Extended.TreeGridView.Nightly, 110.26.5.132-alpha"
#:package Krypton.Toolkit.Suite.Extended.TreeGridView.Nightly@110.26.5.132-alpha
#addin nuget:?package=Krypton.Toolkit.Suite.Extended.TreeGridView.Nightly&version=110.26.5.132-alpha&prereleaseInstall as a Cake Addin
#tool nuget:?package=Krypton.Toolkit.Suite.Extended.TreeGridView.Nightly&version=110.26.5.132-alpha&prereleaseInstall as a Cake Tool
The original source of this code came from "Mark Rideout" via https://docs.microsoft.com/en-us/archive/blogs/markrideout/customizing-the-datagridview-to-support-expandingcollapsing-ala-treegridview.
It was then taken for a ride by several developers to fix some issues, and extend it to take a data source. Then "AngeloCresta" created a Kryptonised version https://github.com/ncarp/ExtendedRenderer/tree/master/TreeGridView, but did not give any supporting examples of how to use it.
Sometime during amalgamation of the extended suite "WagnerP" moved the code into the code base https://github.com/Krypton-Suite-Legacy-Archive/Krypton-Toolkit-Suite-Extended-NET-5.470/tree/master/Source/Krypton%20Toolkit%20Suite%20Extended/Full%20Toolkit/Extended%20Controls/ExtendedToolkit/Controls/TreeGridView where it rested for a while.
Then "Smurf-IV", picked it up and
I wanted to ensure that the design of the TreeGridView supported normal TreeView type properties and features, so creating necessary classes to create the “tree view” experience was necessary (see object model for more details).
Painting an image in a cell is easy, but ensuring that the text from the DataGridViewTextBoxCell didn’t overlap the image took a bit of work. Using the Padding feature of the DataGridViewCellStyle, I add padding to the left side of the cell to account for the text and the indentation. This padding affects the painting and behavior of the text box cell, so editing a text cell correctly positions the editing control.
Since I don’t want to set padding and styling except when a node is actually displayed. When the node is displayed or in the grid, it is sited. When the node is sited I set all the necessary properties.
Since expanding and collapsing is based upon dynamically adding and removing rows from the grid, I decided that unbound mode would be the best way to go with this. I’ve hidden the “databinding” properties and the virtual mode property since this doesn’t support those features.
One thing that I had to deal with is that double-clicking a cell enters edit mode. This double-click occurs regardless of the padding, so double-click on the +- symbol causes the control to enter edit mode. Edit also enters if you single click on a cell that already has focus. So, to deal with this I turn edit mode to be enabled only through programmatic means. I have code to handle the F2 key to enter edit mode. There are other ways to solve this, but I went with the F2 approach.
Nodes – Again, like the treeview, a node has children, so there is a Nodes property that returns child nodes. One of the challenges in coding this is to know when a node is actually a row or when it is just a node. A node is a row when it is in the grid, otherwise it is just a node.
IsSited – A node is “sited” when it is contained in the grid as a row. The Sited property is true in this case. There are a set of protected virtual methods on the TreeGridView class (SiteNode and UnSiteNode).
ImageIndex – Image index for the node’s image. Only used when an ImageList is associated with the TreeGridView.
Image – Image associated with the node. Sets or gets the image. When an ImageList is associated with the TreeGridView and an ImageIndex is set then this returns an image from the ImageList. You can set the Image property to an image if you aren’t using an ImageList.
Cells – Returns the cells for the given node. This wasn’t easy to do since accessing the cells for a node (or row) when the node isn’t sited. Using the DataGridView’s CreateCells method I can get the correct cells collection when the node isn’t in the grid.
This is a special DataGridView cell that derives from the DataGridViewTextBoxCell. The main thing that this custom cell class does is to customize the cell drawing to make it look like a tree node. That means that it draws the node’s image and the +/- icons and the tree lines. The custom cell also is where a node detects when you click the mouse to expand or collapse a node. NOTE: A lot more work can be done to correctly detect that the mouse is directly over the +/- image. Right now I’m not doing that.
This class derives from the DataGridView control. Many things are done in this class. Nodes are sited/unsited in the grid as actual rows. Some DataGridView Properties are hidden since they do not apply.
VirtualNodes – One of the common things done with a normal TreeView is to dynamically add child nodes when the user is expanding the parent. With the normal TreeView uses add temp child nodes to get the + sign and support expanding, then remove the temp node later. With the VirtualNodes property, the TreeGridView always displays a + sign next to a node, even if the node doesn’t have any children. Then, by handling the Expanding event you can dynamically add child nodes.
ImageList – ImageList associated with the TreeGridView
Nodes – Identifies the root nodes.
ShowLines – Determines if the TreeGridView shows lines between nodes.
CurrentNode – Identifies the node that has focus.
Expanding – Again, like the treeview, this event occurs before a node is starting to expand. You can add nodes in this event to fill in more details of a child node collection. When the VirtualNodes property is true, the TreeGridView will display the node with a + sign next to it even when it doesn’t have any children. Handling the Expanding event is where you would dynamically add new child nodes.
Expanded – After a node is expanded.
Collapsing – Before a node is being collapsed
Collapsed – After a node has been collapsed.
tri-state Checkboxes| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0-windows7.0 net8.0-windows7.0 is compatible. net9.0-windows net9.0-windows was computed. net9.0-windows7.0 net9.0-windows7.0 is compatible. net10.0-windows net10.0-windows was computed. net10.0-windows7.0 net10.0-windows7.0 is compatible. net11.0-windows7.0 net11.0-windows7.0 is compatible. |
| .NET Framework | net472 net472 is compatible. net48 net48 is compatible. net481 net481 is compatible. |
Showing the top 2 NuGet packages that depend on Krypton.Toolkit.Suite.Extended.TreeGridView.Nightly:
| Package | Downloads |
|---|---|
|
Krypton.Toolkit.Suite.Extended.Ultimate.Nightly
The Ultimate all-in-one package for Krypton Toolkit Suite Extended. This package includes ALL Extended Toolkit assemblies and dependencies bundled together for maximum convenience. Supports .NET Framework 4.7.2 - 4.8.1, .NET 8 - 10. All libraries are included targeting each specific framework version for performance purposes. This package includes: - All Extended Toolkit controls and components - All shared utilities and tools - All dependencies required for full functionality - Support for all target frameworks Perfect for applications that need the complete Extended Toolkit without managing individual packages. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md |
|
|
Krypton.Toolkit.Suite.Extended.Ultimate.Lite.Nightly
The Ultimate Lite all-in-one package for Krypton Toolkit Suite Extended. This package includes ALL Extended Toolkit assemblies and dependencies bundled together for maximum convenience. This is the LITE version with reduced framework targets for smaller package size. Supports .NET Framework 4.8 - 4.8.1, .NET 8 - 10. All libraries are included targeting each specific framework version for performance purposes. This package includes: - All Extended Toolkit controls and components - All shared utilities and tools - All dependencies required for full functionality - Support for modern target frameworks (excludes .NET Framework 4.7.2) Perfect for applications targeting modern frameworks that need the complete Extended Toolkit without managing individual packages. Difference from Ultimate package: - Ultimate: Supports net472, net48, net481, net8.0, net9.0, net10.0 - Ultimate.Lite: Supports net48, net481, net8.0, net9.0, net10.0 (excludes net472) To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 110.26.5.132-alpha | 67 | 5/12/2026 |
| 110.26.4.103-alpha | 76 | 4/13/2026 |
| 110.26.4.100-alpha | 66 | 4/10/2026 |
| 110.26.4.96-alpha | 66 | 4/6/2026 |
| 110.26.4.92-alpha | 66 | 4/2/2026 |
| 110.26.3.60-alpha | 66 | 3/1/2026 |
| 110.26.2.50-alpha | 69 | 2/19/2026 |
| 110.26.2.48-alpha | 72 | 2/17/2026 |
| 110.26.2.47-alpha | 63 | 2/16/2026 |
| 110.26.1.29-alpha | 81 | 1/29/2026 |
| 110.26.1.25-alpha | 74 | 1/25/2026 |
| 110.26.1.10-alpha | 78 | 1/10/2026 |
| 110.26.1.5-alpha | 82 | 1/5/2026 |
| 110.26.1.2-alpha | 79 | 1/2/2026 |
| 110.26.1.1-alpha | 82 | 1/1/2026 |
| 100.25.11.320-alpha | 226 | 11/16/2025 |
| 100.25.11.318-alpha | 240 | 11/14/2025 |
| 100.25.11.314-alpha | 240 | 11/10/2025 |
| 100.25.10.300-alpha | 185 | 10/27/2025 |
| 100.25.10.299-alpha | 143 | 10/26/2025 |
Get updates here: https://github.com/Krypton-Suite/Extended-Toolkit