Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions skills/igniteui-blazor-components/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ All four use the `IgniteUI.Blazor.Controls` namespace and serve static assets fr
- **`Name` is not an HTML name attribute.** On every Ignite UI component `Name` is the framework's element identity used for lookups. Do not use it to group radios or to name a form field.
- **Forms.** There is no universal form-integration pattern; several components (`IgbCombo`, `IgbRadio`) do not participate in a plain HTML `<form>`. Bind explicitly with `@bind-Value` / `@bind-Checked` and check the component's doc before assuming form behavior.
- **`*Script` parameters** take the *name* of a JavaScript function registered through `_content/IgniteUI.Blazor/api.js` (Lite) or the `igRegisterScript` window global (full product), not code. Use them for client-side templates (rendered per item in the browser, no server round trip). For events prefer the C# event; the script variant is for synchronous cancellation or purely client-side reactions. See [`client-scripts.md`](./references/client-scripts.md).
- **Event handlers and `StateHasChanged()`.** Ignite UI events are raised from JavaScript, outside Blazor's event batch. Most are `EventCallback<T>` (`Select`, `Change`, `PagingDone`, `SortingDone`, …): like `@onclick`, the page re-renders when the handler reaches its first `await` (or returns) and again when its `Task` completes, so **do not call `StateHasChanged()` for the final state**. Each such call adds one more render, and before the first `await` it renders immediately, before the next line runs (in `@onclick` that part is batched). State set between two later `await`s is not rendered on its own, though: to show a "Saving…" message after a fetch, call `StateHasChanged()` right after setting it. Call it once, after the state change, where Blazor cannot see the change at all: a `[JSInvokable]` method called from a `*Script` handler, and the full product's `Action<T>`-typed events: `IgbGrid` `CellEditDone` / `RowAdded` / `RowDeleted`; chart pointer-move events (`SeriesPointerMove` / `PlotAreaPointerMove`; `IgbDataChart` `SeriesMouseMove` / `SeriesCursorMouseMove`); `IgbDataChart` `PlotAreaMouseEnter` / `Leave` / `Over` and its `AxisLabelMouse*` / `AxisPanelMouse*` events; gauge `ValueChanged`, …. Other chart pointer events are `EventCallback`s: series Enter / Leave / Down / Up / Click, `IgbCategoryChart` `PlotAreaPointerEnter` / `Leave` / `Down` / `Up`, `IgbDataChart` `PlotAreaClicked` / `PlotAreaMouseLeftButtonDown` / `Up`, and `IgbPieChart` `SliceEnter` / `SliceHover` / `SliceLeave` / `SliceClick`. Check the parameter type with `get_api_reference`. An `Action<T>` handler must return `void`.
- **Dynamic `class` values** must be a single C# expression (`class="@ChipClass(item)"`). Mixing literal text with `@(...)` in one attribute raises **RZ9986**.

## MCP server (optional)
Expand Down
24 changes: 23 additions & 1 deletion skills/igniteui-blazor-components/references/charts.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,28 @@ The data source must expose `Open`, `High`, `Low`, `Close` (and usually `Volume`

Binding shapes differ enough between these that guessing fails: read `get_doc` for `treemap-chart`, the geographic-map series types, the specific gauge, or `dashboard-tile` before writing markup. Map series (`IgbGeographicSymbolSeries`, `IgbGeographicShapeSeries`, `IgbGeographicPolylineSeries`, `IgbGeographicProportionalSymbolSeries`) are declared as child components, not added from code, and do not follow Data Chart axis conventions.

## Tooltips

Tooltip support differs per component:

| Component | Tooltip on hover | How to get one |
|---|---|---|
| `IgbCategoryChart`, `IgbFinancialChart` | Yes, by default | `ToolTipType`: `Data` (default), `Item`, `Category`, `Default`, `None` |
| `IgbDataPieChart` | Yes, by default | Built-in tooltip only — it has `ToolTipType` but **no** `TooltipTemplate`; `DataToolTipUnitsText="%"` appends a unit to the value |
| `IgbDataChart` series | No | `ShowDefaultTooltip="true"` or a `TooltipTemplate` on each series, **and** `IgbDataChartInteractivityModule` registered — without the module nothing shows and nothing is logged |
| `IgbPieChart` | No tooltip API | Handle `SliceHover` and position your own element at `e.Position`, which is relative to the chart element (wrap the chart in a `position: relative` element). `SliceEnter` / `SliceLeave` give the slice but no position (`e.Position` is `NaN`): use them to pick and hide the content, and show it once `SliceHover` supplies a position. Moving onto a new slice raises `SliceLeave` (old) and `SliceEnter` (new); `SliceHover` comes only with the next move |
| `IgbDoughnutChart` | No tooltip API; a template set from JS throws on hover ([#491](https://github.com/IgniteUI/igniteui-blazor/issues/491)) | For a ring with tooltips use `IgbDataPieChart` with `InnerExtent` (built-in tooltip; its `InnerExtent` scale differs from the doughnut's — about `0.35` gives a typical donut, `0.55` a thin ring), or `IgbPieChart` with `InnerExtent` plus the `SliceHover` approach above |
| `IgbSparkline`, `IgbRadialGauge` | No working tooltip | — |
| `IgbLinearGauge`, `IgbBulletGraph` | `ShowToolTip="true"` shows only an empty box | Wrap the gauge in an element with an `id` and anchor an `IgbTooltip` to it (see `data-display.md`) |

- **`TooltipTemplate` on `IgbCategoryChart`** (a child `<TooltipTemplate>` `RenderFragment<IgbDataContext>`; `context.Item` is your record) is used only with `ToolTipType` `Item`, `Category` or `Default`. With the default `Data` it is ignored and the built-in tooltip shows; with `None` nothing shows.
- **Guard the template context.** With `ToolTipType.Default`, and for an `IgbDataChart` series `TooltipTemplate`, the template is also rendered with a `null` `context`: `context.Item` then throws a `NullReferenceException` and Blazor shows its error UI. Write `@if (context?.Item is MyRecord row) { … }`.
- **Wrapper.** With `ToolTipType.Default` and on `IgbDataChart` series, the template sits in a `div.ui-tooltip-container` with a white background, a 1px `#666` border and 5px padding; `--tooltip-container-background-color` and `--tooltip-container-border-color` set on `:root` recolor it. With `Item` / `Category`, and with a tooltip layer, the wrapper is transparent over the canvas callout.
- **Placement.** `Data`, `Item` and `Category` tooltips render in a `div.ui-chart-pointer-tooltip-container` appended to `<body>`, outside the chart. `IgbDataChart` series tooltips are a `<body>`-level popover unless the series sets `AttachTooltipToRoot="false"` (ignored once a tooltip layer is present). Only `ToolTipType.Default` and `AttachTooltipToRoot="false"` keep the tooltip inside the chart element.
- **Styling templates.** Inline styles and global CSS always work. A plain selector in the page's `.razor.css` (`.tip`) matches a Razor `TooltipTemplate` wherever it renders, because the template's elements keep the scope attribute. In a `<body>`-level tooltip, `::deep .x` reaches only elements nested inside the template's root, and selectors that start from a page element (`.page .tip`, `.page ::deep .tip`) match nothing; those work only when the tooltip stays inside the chart (`ToolTipType.Default`, or `AttachTooltipToRoot="false"` without a tooltip layer). A template set from JS (`series.tooltipTemplate = …`, for example in a `SeriesAddedScript` handler) carries no scope attribute: use global CSS or inline styles.
- **The `Data` tooltip is drawn on a canvas** — CSS cannot reach its text; use the `DataToolTip*` text parameters.
- **Callout box.** `Data`, `Item` and `Category` tooltips sit on a canvas callout (white fill, grey border) whose colors come from built-in defaults: no token or CSS rule sets them, and `IgbCategoryChart` / `IgbFinancialChart` have no parameter for it ([#493](https://github.com/IgniteUI/igniteui-blazor/issues/493)). In `IgbDataChart`, add an `IgbItemToolTipLayer` or `IgbCategoryToolTipLayer` and set `ToolTipBackground`, `ToolTipBorderBrush`, `ToolTipBorderThickness` (corner radius is not settable). A layer shows only series that have `ShowDefaultTooltip="true"` or a `TooltipTemplate`, and it also needs `IgbDataChartInteractivityModule`.

## Cross-cutting rules

**Explicit `Width` and `Height` are mandatory** — charts do not size to their container on their own. Inside a CSS Grid track also set `min-height: 0` on the cell and `Height="100%"` on the chart, or the track collapses to zero.
Expand All @@ -124,4 +146,4 @@ Binding shapes differ enough between these that guessing fails: read `get_doc` f

**Set visual parameters inline in markup, not via `@ref` in `OnAfterRenderAsync`** — assigning them to a component reference raises Blazor warning **BL0005** (component parameter set outside its component).

**Other common parameters:** default tooltips appear on hover with no configuration (`TooltipTemplate` replaces them); `IsTransitionInEnabled` / `TransitionInDuration` animate entry; `IsSeriesHighlightingEnabled` with `HighlightingMode` / `HighlightingBehavior` controls hover emphasis; `IsHorizontalZoomEnabled` / `IsVerticalZoomEnabled` and `CrosshairsDisplayMode` handle zoom and crosshairs.
**Other common parameters:** `IsTransitionInEnabled` / `TransitionInDuration` animate entry; `IsSeriesHighlightingEnabled` with `HighlightingMode` / `HighlightingBehavior` controls hover emphasis; `IsHorizontalZoomEnabled` / `IsVerticalZoomEnabled` and `CrosshairsDisplayMode` handle zoom and crosshairs.
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,6 @@ registerScript('OnDialogClosing', (evt) => {
});
```

The function is attached as a listener for the matching `igc*` DOM event on the component's element. `evt.detail` holds the event arguments where the event has any; cancelable events (`Opening`/`Closing` on dialogs, dropdowns and the like, `ActiveStepChanging` on the stepper, tree expand/collapse and selection changes, `Change` on some inputs) are cancelled with `evt.preventDefault()`.
The function is attached as a listener for the matching `igc*` DOM event on the component's element. `evt.detail` holds the event arguments where the event has any; cancelable events (`Opening`/`Closing` on dialogs, dropdowns and the like, `ActiveStepChanging` on the stepper, tree expand/collapse and selection changes, `Change` on some inputs) are cancelled with `evt.preventDefault()`. The grids (`IgbGrid`, `IgbTreeGrid`, `IgbHierarchicalGrid`) and `IgbPaginator` are different: none of their events is cancelable, and `preventDefault()` is ignored. Cancel a grid action by setting `evt.detail.cancel = true` in its `*Script` handler (`CellEditScript`, `RowEditScript`, `SortingScript`, `FilteringScript`, `RowAddScript`, `RowDeleteScript`, the paginator's `PagingScript`, …).

A script handler that calls back into .NET (`dotNetRef.invokeMethodAsync('Method', …)`) lands in a `[JSInvokable]` method, and Blazor does not re-render after it. End that method with one `StateHasChanged()` when it changes what the page shows — no `InvokeAsync` is needed, the call already runs on the renderer's dispatcher. Prefer the C# event when you don't need the script's synchronous `preventDefault()`. If that event is an `EventCallback<T>`, its handler re-renders automatically; the full product's `Action<T>` events (gauge `ValueChanged`, chart move events such as `SeriesPointerMove` / `SeriesMouseMove`, `IgbGrid` `RowAdded` / `RowDeleted` / `CellEditDone`, …) do not, so keep one `StateHasChanged()` in those handlers. Chart series Enter / Leave / Click and the pie's `SliceEnter` / `SliceHover` / `SliceLeave` are `EventCallback`s and need none.
8 changes: 8 additions & 0 deletions skills/igniteui-blazor-components/references/layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ Module for every component below is `Igb<Name>Module`. `IgbExpansionPanel` ships

Tab headers come from the `Label` string or from children in the `label` slot; everything left in the default slot is the panel body. There is **no** `IgbTabPanel` component. `IgbTab` has `Label`, `Selected`, `Disabled`. `IgbTabs` has `Alignment`, `Activation`, `SelectAsync(id)`, `GetSelectedAsync()`.

**Alignment and panel width before igniteui-webcomponents 7.5.0** (`IgniteUI.Blazor.Lite` 1.0.x bundles 7.4.1, and `IgniteUI.Blazor` 26.2.x takes its tabs from that Lite dependency). With the Material, Fluent or Indigo theme the tabs' `inner` part is only as wide as the headers: `Alignment` `Center` / `End` / `Justify` look like `Start`, and the panel is only as wide as the header row. Bootstrap is not affected. Add this rule to global CSS, or to the page's `.razor.css` as `::deep igc-tabs::part(inner)` — scoped `::deep` needs an HTML element the page renders itself (e.g. a wrapper `div`) as an ancestor of the tabs:

```css
igc-tabs::part(inner) { flex-grow: 1; }
```

It is the rule 7.5.0 moves into the base styles, so it changes nothing on Bootstrap or after the update. Do **not** use `width: 100%` on that part — once the headers overflow and a later tab is selected, the panel (and in some layouts the start scroll button) scrolls out of view. `igc-tab { width: 100%; }` has no effect (slotted tabs are `display: contents`). Before 7.5.0, `Justify` headers with labels of different lengths grow but are not equal-width. The rule also reaches `igc-tabs` rendered by JS templates in the page's light DOM, but not inside another shadow root.

## Stepper

```razor
Expand Down
2 changes: 1 addition & 1 deletion skills/igniteui-blazor-grids/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ The grid-specific stylesheet is easy to miss and is required whenever any full-f
| State persistence | ❌ | ✅ | ✅ | ✅ | ✅ |
| Virtualization | ✅ | ✅ | ✅ | ✅ | ✅ |
| Load on demand | ❌ | ❌ | ✅ via `LoadChildrenOnDemandScript` | ✅ via `GridCreatedScript` | ❌ |
| Remote data ops | `DataPipelineConfiguration` | events + noop strategies | events + noop strategies | events + noop strategies | ❌ |
| Remote data ops | `DataPipelineConfiguration` | events (see `paging-remote.md`) | events | events | ❌ |

**Batch editing is not available in Blazor** on any grid type. Supported editing modes are cell editing and row editing only — never generate batch-editing code.

Expand Down
Loading
Loading