Skip to main content

LgGridImageColumn

LgGridImageColumn<TItem> displays an image from a URL or a path computed from the bound value.

<Columns Context="item">
<LgGridImageColumn @bind-Value="item.PictureUrl"
Title="#Picture"
AlternativeText="#PictureAlt"
ImageWidth="48px"
ImageHeight="48px" />
</Columns>
  • NuGet package: Lagoon.UI.GridView

Common parameters are documented in LgGridBaseColumn.

Specific parameters​

NameTypeDefaultDescription
AlternativeTextstringnullAlternative text for the image.
ImageHeightstring"100%"CSS height of the image.
ImageWidthstring"100%"CSS width of the image.
UrlPrefixstringnullURL prefix, for example "/api/images/".
UrlSuffixstringnullURL suffix.
TooltipstringnullTooltip displayed on the image.
TooltipIsHtmlboolfalseIndicates whether the tooltip contains HTML.

Usage​

Images from a complete or computed URL​

GridImageColumnPage.razor
@inherits LgPage

<LgGridView StateId="orders-image-column" Items="_orders" Title="#OrdersGridTitle">
<Columns Context="item">
<LgGridImageColumn @bind-Value="item.PictureId"
Title="#Picture"
AlternativeText="#PictureAlt"
UrlPrefix="https://picsum.photos/id/"
UrlSuffix="/120/80"
ImageWidth="120px"
ImageHeight="80px"
Tooltip="#OpenPicture" />
<LgGridImageColumn @bind-Value="item.PictureUrl"
Title="#PictureUrl"
AlternativeText="#PictureAlt"
ImageWidth="48px"
ImageHeight="48px" />
</Columns>
</LgGridView>

UrlPrefix and UrlSuffix surround the bound value to compose a URL; if the value already contains the complete URL, leave them empty.

Filter​

No built-in filter.

Complete reference

API sheet generated from the source code: API reference — LgGridImageColumn.

  • LgGridView — the data grid that hosts the column.
  • LgGridTextColumn — base column and inherited common parameters.
  • LgDocument — display of images and documents protected by authentication.