DataTable
TsgcHTMLComponent_DataTable — a higher-level data table that wraps a Grid and Pagination inside a card with a search toolbar, page-size selector, export button and row count, in Delphi, C++ Builder and .NET.
TsgcHTMLComponent_DataTable — a higher-level data table that wraps a Grid and Pagination inside a card with a search toolbar, page-size selector, export button and row count, in Delphi, C++ Builder and .NET.
Bind a dataset, set a page size and toolbar options, then read the HTML property — the inner Grid and Pagination are exposed if you need finer control.
TsgcHTMLComponent_DataTable
Bootstrap 5 card with toolbar, <table> + pagination
Delphi, C++ Builder, .NET
Set a Title and toolbar flags, call LoadFromDataSet with a page size, then read HTML. Reach the inner Grid to tune columns.
uses
sgcHTML_Component_DataTable;
var
oTable: TsgcHTMLComponent_DataTable;
begin
oTable := TsgcHTMLComponent_DataTable.Create(nil);
try
oTable.Title := 'Customers';
oTable.ShowSearch := True;
oTable.ShowExport := True;
oTable.ShowRowCount := True;
oTable.SearchPlaceholder := 'Search customers...';
oTable.Grid.Striped := True;
oTable.LoadFromDataSet(qryCustomers, 25);
WebModule.Response := oTable.HTML; // card + table + pagination
finally
oTable.Free;
end;
end;
// includes: sgcHTML_Component_DataTable.hpp
TsgcHTMLComponent_DataTable *oTable = new TsgcHTMLComponent_DataTable(NULL);
try
{
oTable->Title = "Customers";
oTable->ShowSearch = true;
oTable->ShowExport = true;
oTable->ShowRowCount = true;
oTable->SearchPlaceholder = "Search customers...";
oTable->Grid->Striped = true;
oTable->LoadFromDataSet(qryCustomers, 25);
String html = oTable->HTML; // card + table + pagination
}
__finally
{
delete oTable;
}
using esegece.sgcWebSockets;
var table = new TsgcHTMLComponent_DataTable();
table.Title = "Customers";
table.ShowSearch = true;
table.ShowExport = true;
table.ShowRowCount = true;
table.SearchPlaceholder = "Search customers...";
table.Grid.Striped = true;
table.LoadFromDataSet(qryCustomers, 25);
string html = table.HTML; // card + table + pagination
The members you reach for most often.
LoadFromDataSet(aDataSet, aPageSize) fills the inner grid and sets pagination from the record count; DataSource drives a live refresh.
ShowSearch with SearchPlaceholder and SearchAction, ShowExport, ShowPageSize with PageSizes, and a Title heading make up the toolbar.
ShowRowCount prints the visible-rows summary next to the pagination control at the bottom of the card.
Grid exposes the full TsgcHTMLComponent_Grid — set Striped, Bordered, columns, sort/filter and more directly on it.
Pagination exposes the TsgcHTMLComponent_Pagination instance for CurrentPage, PageSize and TotalItems.
TableID identifies the card and inner table; ToolbarClass overrides the default toolbar row classes.