-
Notifications
You must be signed in to change notification settings - Fork 1
1023407: Updated styles and appearance documentation in treegrid #8278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Sanjai-SF5070
wants to merge
17
commits into
development
Choose a base branch
from
1023407-Treegrid
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 10 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
e507ccc
1023407: Updated styles and appearance documentation in treegrid
Sanjai-SF5070 637fe1e
1023407: committed changes
Sanjai-SF5070 456c540
1023407: Routing updated
Sanjai-SF5070 d4afc25
1023407: Changed tabtitle for the sample
Sanjai-SF5070 9e0e845
1023407: changed tabtitle for the samples
Sanjai-SF5070 d9c074a
1023407: Resolved file path error
Sanjai-SF5070 678d45d
1023407: Added documentation for Editing and Filtering
Sanjai-SF5070 cf8b560
1023407: Added routing for filtering and editing
Sanjai-SF5070 6eb6bf2
1023407: resolved routing issue
Sanjai-SF5070 bba1f26
Merge branch 'development' of https://github.com/syncfusion-content/b…
Sanjai-SF5070 2ec5dda
Merge branch 'development' into 1023407-Treegrid
MuthukumarSF3941 bcebb45
1023407: Changed command column images
Sanjai-SF5070 5e3e3e4
Merge branch '1023407-Treegrid' of https://github.com/syncfusion-cont…
Sanjai-SF5070 0dcc2b2
1023407: Changed the title properly
Sanjai-SF5070 8ff8ae1
Merge branch 'development' into 1023407-Treegrid
MuthukumarSF3941 6e48d14
1023407: Added doc for expand collapse
Sanjai-SF5070 7b0dd7c
Merge branch '1023407-Treegrid' of https://github.com/syncfusion-cont…
Sanjai-SF5070 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file added
BIN
+22.8 KB
blazor/treegrid/images/style-and-appearance/aggregate-cell-element.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+25.6 KB
blazor/treegrid/images/style-and-appearance/aggregate-root-element.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.7 KB
blazor/treegrid/images/style-and-appearance/edit-dialog-header-element.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+18.5 KB
blazor/treegrid/images/style-and-appearance/edited-added-row-element.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.2 KB
blazor/treegrid/images/style-and-appearance/edited-row-input-element.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.3 KB
...rid/images/style-and-appearance/excel-filter-dialog-number-filters-element.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16 KB
blazor/treegrid/images/style-and-appearance/filter-bar-cell-element.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.2 KB
blazor/treegrid/images/style-and-appearance/filter-bar-input-clear-icon.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.8 KB
blazor/treegrid/images/style-and-appearance/filter-bar-input-element-focus.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.2 KB
blazor/treegrid/images/style-and-appearance/filter-bar-input-element.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.1 KB
blazor/treegrid/images/style-and-appearance/filter-dialog-button-element.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.1 KB
blazor/treegrid/images/style-and-appearance/filter-dialog-content.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.6 KB
blazor/treegrid/images/style-and-appearance/filter-dialog-footer.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.3 KB
blazor/treegrid/images/style-and-appearance/filter-dialog-input-element.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+22.9 KB
blazor/treegrid/images/style-and-appearance/grid-header-cell-div-element.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+33 KB
...eegrid/images/style-and-appearance/grid-pager-current-page-numeric-element.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+29.4 KB
blazor/treegrid/images/style-and-appearance/pager-page-numeric-link-elements.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+34 KB
blazor/treegrid/images/style-and-appearance/treegrid-pager-container-element.webp
Oops, something went wrong.
Binary file added
BIN
+32.9 KB
blazor/treegrid/images/style-and-appearance/treegrid-pager-navigation-element.webp
Oops, something went wrong.
Binary file added
BIN
+29.7 KB
blazor/treegrid/images/style-and-appearance/treegrid-pager-root-element.webp
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,219 @@ | ||
| --- | ||
| layout: post | ||
| title: Customize aggregates in Blazor TreeGrid | Syncfusion | ||
| description: Learn how to customize aggregate rows in the Syncfusion Blazor TreeGrid using CSS, including footer containers and summary cells. | ||
| platform: Blazor | ||
| control: TreeGrid | ||
| documentation: ug | ||
| --- | ||
|
|
||
| # Aggregate customization in Syncfusion Blazor TreeGrid | ||
|
|
||
| Aggregates are displayed as summary rows in the TreeGrid footer, providing a consolidated view of totals, averages, or counts. These rows can be styled using CSS to match the layout and design of the TreeGrid. Styling options are available for: | ||
|
|
||
| - **Aggregate root container:** The outer wrapper of the footer row. | ||
| - **Aggregate summary row and cells:** The row that shows summary values, and the cells that display each result. | ||
|
|
||
| ## Customize the aggregate root element | ||
| The **.e-gridfooter** class styles the root container of the aggregate footer row. Use CSS to adjust its appearance: | ||
|
|
||
| ```css | ||
| .e-treegrid .e-gridfooter { | ||
| font-family: cursive; | ||
| } | ||
| ``` | ||
|
|
||
| Properties like **font-family**, **font-size**, and **padding** can be changed to fit the TreeGrid layout design. | ||
|
|
||
|  | ||
|
|
||
| ## Customize the aggregate cell elements | ||
|
|
||
| The **.e-summaryrow** and **.e-summarycell** classes define the appearance of the summary row and its individual cells in the Blazor TreeGrid. Apply CSS to modify their look: | ||
|
|
||
| ```css | ||
| .e-treegrid .e-summaryrow .e-summarycell { | ||
| background-color: #deecf9; | ||
| } | ||
| ``` | ||
|
|
||
| Properties such as **background-color**, **color**, and **text-align** can be adjusted to improve clarity and interaction. | ||
|
|
||
|  | ||
|
|
||
| {% tabs %} | ||
| {% highlight razor tabtitle="Index.razor" %} | ||
|
|
||
| @using Syncfusion.Blazor.TreeGrid | ||
| @using Syncfusion.Blazor.Grids | ||
| <SfTreeGrid DataSource="@TreeGridData" IdMapping="ID" ParentIdMapping="ParentID" Height="362" TreeColumnIndex="1" AllowPaging="true"> | ||
| <TreeGridPageSettings PageSizes="@PageSizes" PageCount="5" PageSize="2" PageSizeMode="PageSizeMode.Root"></TreeGridPageSettings> | ||
| <TreeGridEditSettings AllowEditing="true"></TreeGridEditSettings> | ||
| <TreeGridColumns> | ||
| <TreeGridColumn Field="ShipID" HeaderText="Ship ID" Width="80" Visible="false" IsPrimaryKey="true" TextAlign="TextAlign.Right"></TreeGridColumn> | ||
| <TreeGridColumn Field="Name" ClipMode="ClipMode.EllipsisWithTooltip" HeaderText="Orders" Width="100"></TreeGridColumn> | ||
| <TreeGridColumn Field="ShipmentCategory" HeaderText="Category" Width="100"></TreeGridColumn> | ||
| <TreeGridColumn Field="Units" HeaderText="Units" Width="80" TextAlign="TextAlign.Right"></TreeGridColumn> | ||
| <TreeGridColumn Field="UnitPrice" ClipMode="ClipMode.EllipsisWithTooltip" HeaderText="Unit Price" Format="c2" Width="90" TextAlign="TextAlign.Right"></TreeGridColumn> | ||
| <TreeGridColumn Field="OrderDate" HeaderText="Ordered Date" ClipMode="ClipMode.EllipsisWithTooltip" Format="d" Type="ColumnType.Date" Width="120" TextAlign="TextAlign.Right"></TreeGridColumn> | ||
| <TreeGridColumn Field="ShippedDate" HeaderText="Shipped Date" ClipMode="ClipMode.EllipsisWithTooltip" Format="d" Type="ColumnType.Date" Width="120" TextAlign="TextAlign.Right"></TreeGridColumn> | ||
|
|
||
| </TreeGridColumns> | ||
| <TreeGridAggregates> | ||
| <TreeGridAggregate ShowChildSummary="false"> | ||
| <TreeGridAggregateColumns> | ||
| <TreeGridAggregateColumn Field="UnitPrice" Type="Syncfusion.Blazor.Grids.AggregateType.Sum" Format="C2"> | ||
| <FooterTemplate> | ||
| @{ | ||
| var sumvalue = (context as Syncfusion.Blazor.Grids.AggregateTemplateContext); | ||
| <div class="aggregate-chip"> | ||
| Sum: @sumvalue.Sum | ||
| </div> | ||
| } | ||
| </FooterTemplate> | ||
| </TreeGridAggregateColumn> | ||
| </TreeGridAggregateColumns> | ||
| </TreeGridAggregate> | ||
| <TreeGridAggregate ShowChildSummary="false"> | ||
| <TreeGridAggregateColumns> | ||
| <TreeGridAggregateColumn Field="UnitPrice" Type="Syncfusion.Blazor.Grids.AggregateType.Max" Format="C2"> | ||
| <FooterTemplate> | ||
| @{ | ||
| var sumvalue = (context as Syncfusion.Blazor.Grids.AggregateTemplateContext); | ||
| <div class="aggregate-chip"> | ||
| Max: @sumvalue.Max | ||
| </div> | ||
| } | ||
| </FooterTemplate> | ||
| </TreeGridAggregateColumn> | ||
| </TreeGridAggregateColumns> | ||
| </TreeGridAggregate> | ||
| </TreeGridAggregates> | ||
| </SfTreeGrid> | ||
|
|
||
| <style> | ||
| .e-treegrid .e-gridfooter { font-family: cursive; background-color: #f5f8fc; } | ||
| .e-treegrid .e-summaryrow .e-summarycell { background-color: #deecf9; } | ||
| .aggregate-chip { padding: 4px 8px; border-radius: 6px; background-color: #fff; border: 1px solid #bcd3ea; display: inline-block; min-width: 120px; text-align: center; color: #0b3f73; font-weight: 600; } | ||
| .e-treegrid .e-summarycell:focus-visible { outline: 2px solid #005a9e; outline-offset: -2px; } | ||
| </style> | ||
|
|
||
| @code { | ||
| private List<ShipmentData> TreeGridData { get; set; } = new List<ShipmentData>(); | ||
| private List<string> PageSizes { get; set; } = new List<string>(); | ||
| protected override void OnInitialized() | ||
| { | ||
| TreeGridData = ShipmentData.GetData(); | ||
| PageSizes = new List<string>() { "2", "4", "5", "10", "15", "20", "All" }; | ||
| } | ||
| } | ||
|
|
||
| {% endhighlight %} | ||
|
|
||
| {% highlight c# tabtitle="ShipmentData.cs" %} | ||
|
|
||
| public class ShipmentData | ||
| { | ||
| public int? ID { get; set; } | ||
| public int? ShipID { get; set; } | ||
| public string? Name { get; set; } | ||
| public int? Units { get; set; } | ||
| public string? Category { get; set; } | ||
| public int? UnitPrice { get; set; } | ||
| public int? Price { get; set; } | ||
| public int? TotalPrice { get; set; } // Added for total price calculation (sum for parents, individual for items) | ||
| public string? ShipmentCategory { get; set; } | ||
| public DateTime? ShippedDate { get; set; } = null; | ||
| public DateTime? OrderDate { get; set; } = null; | ||
| public string? OrderReached { get; set; } = null; | ||
| public int? ParentID { get; set; } | ||
| private static void CalculateTotalPrices(List<ShipmentData> data) | ||
| { | ||
| // For items (non-parents), TotalPrice = Price | ||
| // For parents, TotalPrice = sum of children's TotalPrice | ||
| var parents = data.Where(d => d.ParentID == null).ToList(); | ||
| foreach (var parent in parents) | ||
| { | ||
| var children = data.Where(d => d.ParentID == parent.ID).ToList(); | ||
| parent.TotalPrice = children.Sum(c => c.Price ?? 0); | ||
| // Recursively set for children if nested, but here it's flat tree | ||
| } | ||
| // Set for items | ||
| foreach (var item in data.Where(d => d.ParentID != null)) | ||
| { | ||
| item.TotalPrice = item.Price; | ||
| } | ||
| } | ||
| public static List<ShipmentData> GetData() | ||
| { | ||
| var data = new List<ShipmentData>(capacity: 150); | ||
| var rnd = new Random(42); // deterministic | ||
| var baseOrderDate = new DateTime(2025, 1, 1); | ||
| // pools for categories/items - standardized to Title Case | ||
| var categories = new[] | ||
| { | ||
| ("Seafood", new[] { "Mackerel", "Herrings", "Tilapias", "White Shrimp", "Yellowfin Tuna" }), | ||
| ("Dairy", new[] { "Fresh Cheese", "Blue Veined Cheese", "Butter", "Milk", "Yogurt" }), | ||
| ("Edible", new[] { "Preserved Olives", "Sweet corn", "Pickles", "Tomato Puree", "Olive Oil" }), | ||
| ("Crystals", new[] { "Lead glassware", "Pharmaceutical glass", "Glass beads", "Crystal vials", "Borosilicate glass" }), | ||
| ("Fresh Vegetables", new[] { "Broccoli", "Spinach", "Carrots", "Lettuce", "Cabbage" }), | ||
| ("Leafy Greens", new[] { "Kale", "Arugula", "Chard", "Collards", "Mustard Greens" }), | ||
| ("Root Vegetables", new[] { "Beets", "Radish", "Parsnip", "Turnip", "Rutabaga" }), | ||
| ("Paper", new[] { "Printer Paper", "Photo Paper", "Sticky Notes", "Card Stock", "Plotter Rolls" }), | ||
| ("Consumables", new[] { "Ink Cartridges", "Toner", "Markers", "Glue Sticks", "Tape Rolls" }), | ||
| ("Tools", new[] { "Staplers", "Hole Punch", "Cutters", "Rulers", "Scissors" }), | ||
| ("Stationery", new[] { "Notebooks", "Pens", "Pencils", "Folders", "Envelopes" }) | ||
| }; | ||
| int id = 0; | ||
| int shipSeed = 4500; | ||
| for (int p = 1; p <= 40; p++) | ||
| { | ||
| int parentId = id++; | ||
| data.Add(new ShipmentData | ||
| { | ||
| ID = parentId, | ||
| Name = $"Order {p}", | ||
| ParentID = null | ||
| }); | ||
| for (int c = 0; c < 4; c++) | ||
| { | ||
| // pick a category and item name | ||
| var (cat, items) = categories[(p + c) % categories.Length]; | ||
| var itemName = items[(p * 3 + c) % items.Length]; | ||
| // numbers | ||
| int units = 20 + rnd.Next(11); // 20..30 | ||
| int unitPrice = 5 + rnd.Next(20); // 5..24 | ||
| int price = units * unitPrice; | ||
| // dates | ||
| var orderDate = baseOrderDate.AddDays(p * 7 + c * 3); | ||
| var shipLag = 3 + rnd.Next(10); // 3..12 days | ||
| var shippedDate = orderDate.AddDays(shipLag); | ||
| // reached? | ||
| var reached = shippedDate >= orderDate.AddDays(7) && rnd.Next(100) > 30 ? "Yes" : "No"; | ||
| data.Add(new ShipmentData | ||
| { | ||
| ID = id, | ||
| ShipID = shipSeed + id, | ||
| Name = itemName, | ||
| Category = cat, | ||
| Units = units, | ||
| UnitPrice = unitPrice, | ||
| Price = price, | ||
| OrderDate = orderDate, | ||
| ShippedDate = shippedDate, | ||
| ShipmentCategory = cat, | ||
| OrderReached = reached, | ||
| ParentID = parentId | ||
| }); | ||
| id++; | ||
| } | ||
| } | ||
| CalculateTotalPrices(data); | ||
| return data; | ||
| } | ||
| } | ||
|
|
||
| {% endhighlight %} | ||
| {% endtabs %} | ||
|
|
||
| {% previewsample "https://blazorplayground.syncfusion.com/embed/LDrxtJrVJUhwQJZe?appbar=false&editor=false&result=true&errorlist=false&theme=fluent2" %} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.