Skip to content

Financial Portfolio sample: live data grid with templated cells and Bootstrap theme#18

Open
Zneeky wants to merge 8 commits into
aahmedov/fleet-managment-sample-blazorfrom
aahmedov/financial-portfolio-sample-blazor
Open

Financial Portfolio sample: live data grid with templated cells and Bootstrap theme#18
Zneeky wants to merge 8 commits into
aahmedov/fleet-managment-sample-blazorfrom
aahmedov/financial-portfolio-sample-blazor

Conversation

@Zneeky

@Zneeky Zneeky commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Closes #4
Implements the Financial Portfolio sample (#4) — a live IgbGrid portfolio matching the IgniteUI Web Components finance example.

Stacked on top of the fleet-management sample, so this PR targets aahmedov/fleet-managment-sample-blazor and its diff is only the finance changes.

Highlights

  • 11-column portfolio grid — symbol, asset, position, prices, daily change, market value, net profit/loss (value & %), allocation, holding period — with sorting, column hiding/pinning and multi-row selection.
  • Native lit-html cell templates (BodyTemplateScript) so the live updates don't flicker: company-logo avatars, green/red profit-loss values with trending up/down icons, and a (thick) allocation progress bar.
  • Live 3s price ticks. Two Blazor WebAssembly fixes were needed: System.Timers.Timer doesn't fire reliably on the single WASM thread → switched to a PeriodicTimer loop; and in-place mutations don't re-sync to the grid → assign a new data-list reference each tick.
  • Full Bootstrap / Light theme scoped to the section — the actual bootstrap grid + component theme CSS is prefixed to #finance-section (not just the color tokens), so the toolbar buttons, inputs, checkboxes and grid chrome render as real bootstrap.
  • Web Components toolbar 1:1 — title on the left, a per-keystroke "Filter by Asset" search bar (filters by symbol or asset), and the hiding / pinning / Export actions on the right.

Notes

  • Cell templates are registered in samples/FinanceGrid/wwwroot/scripts/finance-grid-templates.js and loaded from the host page; company logos copied into wwwroot/companies.
  • The search uses a native <input type="search"> with @bind:event="oninput" because IgbInput's Input event doesn't fire on typing and ValueChanged is blur-only.
  • A few MCP gaps hit while building this are logged in the shared mcp-inconsistencies tracker (sparse IgbLinearProgress API; search_api ignoring the framework filter).

Verification

Built and exercised in the browser: all 11 columns render and fit, prices tick live without flicker, the search filters on every keystroke, and there are no console errors.

Zneeky added 7 commits June 10, 2026 13:47
…cells and Bootstrap theme

- Rebuild the Financial Portfolio grid to match the IgniteUI Web Components finance sample:
  11 columns (symbol, asset, position, prices, daily change, market value, net profit/loss,
  allocation, holding period) with sorting, filtering, column hiding/pinning and multi-row selection.
- Render image/icon/bar cells via native lit-html BodyTemplateScript so the live 3s price
  updates do not flicker (the fleet-sample lesson): company-logo avatars, green/red profit and
  loss values with trending up/down icons, and an allocation progress bar.
- Fix the live updates for Blazor WebAssembly: replace System.Timers.Timer (does not fire
  reliably on the single WASM thread) with a PeriodicTimer loop, and assign a new data list
  reference each tick so the grid re-syncs the mutated rows.
- Apply the Bootstrap / Light theme scoped to the finance section; add HoldingPeriod to the
  model; remove unused RCL boilerplate.
…bar and exporter

- Replace the per-column filter row with the Web Components toolbar layout: the title and a
  "Filter by Asset" search bar with the hiding, pinning and Excel exporter actions.
- The search filters by Symbol or Asset (case-insensitive contains) via a client-side LINQ
  view bound to the grid, which keeps working through the live price updates.
… and match the toolbar layout

- Previously only the Bootstrap color *tokens* were scoped to the section, so the grid kept the
  host's Material *structure*. Scope the actual Bootstrap grid + component theme CSS to
  #finance-section (selectors prefixed; :root rescoped; @keyframes/@font-face/@import dropped so
  the host theme still provides them) so the toolbar buttons, inputs, checkboxes and grid chrome
  render as Bootstrap.
- Match the Web Components toolbar layout: title on the left, the "Filter by Asset" search bar on
  the right next to the hiding/pinning/exporter actions (the title/search live in portal wrappers,
  so flex-start + margin-left:auto on the search rather than space-between).
- Use the full "Average Cost/Share" column header.
…ut styling, remove section gap

- The IgbInput Input event does not fire on typing and ValueChanged is blur-only, so the search
  only updated on blur. Replace it with a native <input type="search"> bound via
  @Bind:event="oninput", so the grid filters on every keystroke.
- Style the search field to match the Bootstrap design: white field, gray border, rounded
  corners, blue focus ring and the native clear button.
- Drop the .finance-container padding that left a gap between the themed section and the grid.
…ocation bar

- The column widths summed to 109%, so the grid overflowed horizontally and the last column
  (Holding Period) was pushed off-screen. Reduce the widths to ~95% so every column, including
  Holding Period, fits within the grid without scrolling.
- Make the allocation progress bar noticeably thicker (12px, large size) to match the design.
… close the right gap

- The previous bar fix sized the igc-linear-progress host (12px), but its internal base/track/fill
  parts stayed fixed at 4px. Size those ::part elements directly so the bar is actually thick.
- Widen the Asset column so the data columns fill the grid width (~97.5%), removing the empty
  space that was left on the right edge.
…blazor' into aahmedov/financial-portfolio-sample-blazor
@Zneeky Zneeky requested a review from dkamburov June 12, 2026 06:39
…blazor' into aahmedov/financial-portfolio-sample-blazor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant