Inhaltsverzeichnis
API: Data Controls
API Reference for data views and grids.
TWvdSDataGrid
Powerful data grid.
Namespace
WvdS.UI.Controls.Data
PXAML
<DataGrid ItemsSource="{Binding Orders}" SelectedItem="{Binding SelectedOrder}" AutoGenerateColumns="False"> <DataGrid.Columns> <TextColumn Header="Order ID" Binding="{Binding Id}" Width="80" /> <TextColumn Header="Customer" Binding="{Binding CustomerName}" Width="*" /> <DateColumn Header="Date" Binding="{Binding OrderDate}" /> <NumberColumn Header="Total" Binding="{Binding Total}" Format="C2" /> </DataGrid.Columns> </DataGrid>
Properties
| Property | Type | Default | Description |
| ItemsSource | IEnumerable | nil | Data source |
|---|---|---|---|
| SelectedItem | TObject | nil | Selected row |
| SelectedItems | IList | nil | Multiple selection |
| Columns | TWvdSColumnCollection | nil | Column definition |
| AutoGenerateColumns | Boolean | True | Auto columns |
| CanUserSort | Boolean | True | Sorting allowed |
| CanUserFilter | Boolean | True | Filtering allowed |
| CanUserGroup | Boolean | False | Grouping allowed |
| CanUserReorderColumns | Boolean | True | Column reorder |
| CanUserResizeColumns | Boolean | True | Column resize |
| SelectionMode | TWvdSSelectionMode | smSingle | Single, Multiple, Extended |
| RowHeight | Integer | 25 | Row height |
| AlternatingRowBackground | TWvdSBrush | nil | Alternating row color |
Column Types
| Type | Description |
| TextColumn | Text column |
|---|---|
| NumberColumn | Numeric column with format |
| DateColumn | Date column |
| CheckBoxColumn | Boolean column |
| ComboBoxColumn | Dropdown column |
| TemplateColumn | Custom column |
Events
| Event | Signature | Description |
| OnSelectionChanged | TSelectionChangedEvent | Selection changed |
|---|---|---|
| OnCellClick | TCellClickEvent | Cell clicked |
| OnRowDoubleClick | TRowEvent | Row double-click |
| OnSortChanged | TSortEvent | Sort changed |
TUI Note
In TUI target, virtualization is used. Only visible rows are rendered.
TWvdSTreeList
Hierarchical tree view with columns.
Namespace
WvdS.UI.Controls.Data
PXAML
<TreeList ItemsSource="{Binding Departments}" ChildrenPath="Children" ExpandedNodes="{Binding ExpandedDepts}"> <TreeList.Columns> <TextColumn Header="Name" Binding="{Binding Name}" Width="*" /> <NumberColumn Header="Employees" Binding="{Binding EmployeeCount}" /> </TreeList.Columns> </TreeList>
Properties
| Property | Type | Default | Description |
| ItemsSource | IEnumerable | nil | Root data |
|---|---|---|---|
| ChildrenPath | string | 'Children' | Path to children |
| SelectedNode | TObject | nil | Selected node |
| ExpandedNodes | IList | nil | Expanded nodes |
| Columns | TWvdSColumnCollection | nil | Columns |
| ShowLines | Boolean | True | Connection lines |
| ShowRootLines | Boolean | True | Root lines |
Events
| Event | Signature | Description |
| OnNodeExpanding | TNodeEvent | Node is expanding |
|---|---|---|
| OnNodeCollapsing | TNodeEvent | Node is collapsing |
| OnSelectedNodeChanged | TNodeEvent | Selection changed |
TWvdSCardView
Card-based data view.
Namespace
WvdS.UI.Controls.Data
PXAML
<CardView ItemsSource="{Binding Products}" CardWidth="200" CardHeight="250"> <CardView.CardTemplate> <StackPanel> <Image Source="{Binding ImageUrl}" Height="120" /> <Label Text="{Binding Name}" FontWeight="Bold" /> <Label Text="{Binding Price, StringFormat='$ {0:N2}'}" /> </StackPanel> </CardView.CardTemplate> </CardView>
Properties
| Property | Type | Default | Description |
| ItemsSource | IEnumerable | nil | Data source |
|---|---|---|---|
| CardTemplate | TWvdSDataTemplate | nil | Card template |
| CardWidth | Integer | 200 | Card width |
| CardHeight | Integer | 150 | Card height |
| Orientation | TWvdSOrientation | oHorizontal | Arrangement |
TWvdSPivotGrid
Pivot table for data analysis.
Namespace
WvdS.UI.Controls.Data
PXAML
<PivotGrid DataSource="{Binding SalesData}"> <PivotGrid.RowFields> <PivotField FieldName="Region" /> <PivotField FieldName="Product" /> </PivotGrid.RowFields> <PivotGrid.ColumnFields> <PivotField FieldName="Year" /> </PivotGrid.ColumnFields> <PivotGrid.DataFields> <PivotField FieldName="Amount" SummaryType="Sum" /> </PivotGrid.DataFields> </PivotGrid>
Properties
| Property | Type | Default | Description |
| DataSource | IEnumerable | nil | Data source |
|---|---|---|---|
| RowFields | TPivotFieldCollection | nil | Row fields |
| ColumnFields | TPivotFieldCollection | nil | Column fields |
| DataFields | TPivotFieldCollection | nil | Data fields |
| FilterFields | TPivotFieldCollection | nil | Filter fields |
TWvdSVerticalGrid
Vertical property grid.
Namespace
WvdS.UI.Controls.Data
PXAML
<VerticalGrid SelectedObject="{Binding CurrentItem}"> <VerticalGridRow Caption="Name" FieldName="Name" /> <VerticalGridRow Caption="Description" FieldName="Description" RowType="Memo" /> <VerticalGridRow Caption="Price" FieldName="Price" RowType="SpinEdit" /> </VerticalGrid>
Properties
| Property | Type | Default | Description |
| SelectedObject | TObject | nil | Edited object |
|---|---|---|---|
| Rows | TVerticalGridRowCollection | nil | Row definition |
| CategoryMode | Boolean | False | Show categories |
TWvdSBandedGridView
Grid with column bands.
Namespace
WvdS.UI.Controls.Data
PXAML
<DataGrid ItemsSource="{Binding Data}" ViewType="Banded"> <DataGrid.Bands> <Band Header="Personal Info"> <TextColumn Header="Name" Binding="{Binding Name}" /> <TextColumn Header="Email" Binding="{Binding Email}" /> </Band> <Band Header="Address"> <TextColumn Header="City" Binding="{Binding City}" /> <TextColumn Header="Country" Binding="{Binding Country}" /> </Band> </DataGrid.Bands> </DataGrid>
TWvdSLayoutView
Form layout view.
Namespace
WvdS.UI.Controls.Data
PXAML
<DataGrid ItemsSource="{Binding Contacts}" ViewType="Layout"> <DataGrid.LayoutTemplate> <LayoutGroup> <LayoutItem Caption="Name" FieldName="Name" /> <LayoutItem Caption="Phone" FieldName="Phone" /> <LayoutItem Caption="Notes" FieldName="Notes" RowSpan="2" /> </LayoutGroup> </DataGrid.LayoutTemplate> </DataGrid>
TWvdSWinExplorerView
Windows Explorer-style view.
Namespace
WvdS.UI.Controls.Data
PXAML
<DataGrid ItemsSource="{Binding Files}" ViewType="WinExplorer" ThumbnailField="Icon" TextField="Name" DescriptionField="Modified" />
Properties
| Property | Type | Default | Description |
| ViewMode | TWvdSExplorerViewMode | evmList | ExtraLargeIcons, LargeIcons, MediumIcons, SmallIcons, List, Details, Tiles, Content |
|---|---|---|---|
| ThumbnailField | string | | Thumbnail field |
^ TextField | string | | Text field |
TWvdSTileView
Tile view for data.
Namespace
WvdS.UI.Controls.Data
PXAML
<DataGrid ItemsSource="{Binding Items}" ViewType="Tile" TileWidth="150" TileHeight="100"> <DataGrid.TileTemplate> <StackPanel> <Label Text="{Binding Title}" FontWeight="Bold" /> <Label Text="{Binding Subtitle}" /> </StackPanel> </DataGrid.TileTemplate> </DataGrid>
TWvdSServerModeSource
Server-side data source for large datasets.
Namespace
WvdS.UI.Controls.Data
Syntax
TServerModeSource = class property KeyExpression: string; property QueryableSource: IQueryable; procedure Reload; end;
Usage
var Source: TWvdSServerModeSource; begin Source := TWvdSServerModeSource.Create; Source.KeyExpression := 'Id'; Source.OnFetch := @HandleFetch; DataGrid.ItemsSource := Source; end; procedure HandleFetch(Sender: TObject; Args: TFetchEventArgs); begin Args.Result := QueryDatabase(Args.Skip, Args.Take, Args.SortInfo); end;
See Also
Zuletzt geändert: on 2026/01/29 at 10:32 PM