You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f41cc97
Browse filesBrowse the repository at this point in the historyBrowse files
Move Grid column chooser and export demos to their own pages (#1411)
Add Grid > Column Chooser (/demos/grid/column-chooser) and Grid > Export
(/demos/grid/export) to both demo menus, move the two demos out of
Grid > Other, and point the docs links at the new pages.
Let people choose which columns they see and in what order. A <b>Columns</b> button above the grid opens a list with a search box, a checkbox for each column, and move up and move down buttons; columns can also be dragged.
16
+
<br />
17
+
<strong>How to use:</strong>
18
+
<divclass="content mb-2">
19
+
<ol>
20
+
<li>Set <code>AllowColumnChooser="true"</code> on the Grid.</li>
21
+
<li>Give each column a <code>PropertyName</code> or <code>HeaderText</code>; the chooser lists the columns by it.</li>
22
+
<li>Set <code>AlwaysVisible="true"</code> on a column people must not hide. The last visible column can never be hidden.</li>
23
+
<li>To keep the choice, handle <code>GridSettingsChanged</code> and return the saved settings from <code>SettingsProvider</code>. <code>GridSettings.ColumnOrder</code> and <code>GridSettings.HiddenColumns</code> hold it. <b>Reset to default</b>, or <code>ResetColumnsAsync()</code>, restores the declared columns.</li>
24
+
</ol>
25
+
</div>
26
+
Change the text with <code>ColumnChooserButtonText</code>, <code>ColumnChooserSearchPlaceholderText</code>, <code>ColumnChooserResetText</code>, and the other <code>ColumnChooser*Text</code> parameters.
privateconststringpageDescription="The Blazor Grid component shows tabular data with client-side or server-side paging, sorting and filtering, plus selection, a column chooser, saved settings and CSV export. The example below lets people show, hide and reorder columns, and keeps their choice in saved grid settings.";
privateconststringmetaDescription="Live Blazor Grid column chooser example with source code: show, hide, search and reorder columns, keep a column always visible, and save the choice in grid settings.";
<SectionSize="HeadingSize.H2"Name="Export to CSV"PageUrl="@pageUrl"Link="export-to-csv">
14
+
<divclass="mb-3">
15
+
An <b>Export CSV</b> button downloads every row that matches the current filters and sort, across all pages, with the columns people see, in their order.
16
+
<br />
17
+
<strong>How to use:</strong>
18
+
<divclass="content mb-2">
19
+
<ol>
20
+
<li>Set <code>AllowExport="true"</code> on the Grid, and optionally <code>ExportFileName</code>.</li>
21
+
<li>Give each exported column a <code>PropertyName</code>; its value is written with the grid's culture. Set <code>Exportable="false"</code> on columns such as actions.</li>
22
+
<li>With a <code>DataProvider</code>, return all matching rows when <code>PageNumber</code> and <code>PageSize</code> are 0. <code>request.ApplyTo(...)</code> already does.</li>
23
+
<li>Call <code>ExportToCsvAsync()</code> to export from your own button.</li>
24
+
</ol>
25
+
</div>
26
+
Text that starts with <code>=</code>, <code>+</code>, <code>-</code>, or <code>@@</code> is written with a leading apostrophe, so spreadsheet apps don't run it as a formula.
privateconststringpageDescription="The Blazor Grid component shows tabular data with client-side or server-side paging, sorting and filtering, plus selection, a column chooser, saved settings and CSV export. The example below exports every filtered and sorted row, across all pages, to a CSV file.";
35
+
privateconststringmetaTitle="Blazor Grid export to CSV example";
36
+
privateconststringmetaDescription="Live Blazor Grid export to CSV example with source code: export every filtered and sorted row across all pages, with the visible columns in their order, from the built-in button or your own.";
Let people choose which columns they see and in what order. A <b>Columns</b> button above the grid opens a list with a search box, a checkbox for each column, and move up and move down buttons; columns can also be dragged.
47
-
<br />
48
-
<strong>How to use:</strong>
49
-
<divclass="content mb-2">
50
-
<ol>
51
-
<li>Set <code>AllowColumnChooser="true"</code> on the Grid.</li>
52
-
<li>Give each column a <code>PropertyName</code> or <code>HeaderText</code>; the chooser lists the columns by it.</li>
53
-
<li>Set <code>AlwaysVisible="true"</code> on a column people must not hide. The last visible column can never be hidden.</li>
54
-
<li>To keep the choice, handle <code>GridSettingsChanged</code> and return the saved settings from <code>SettingsProvider</code>. <code>GridSettings.ColumnOrder</code> and <code>GridSettings.HiddenColumns</code> hold it. <b>Reset to default</b>, or <code>ResetColumnsAsync()</code>, restores the declared columns.</li>
55
-
</ol>
56
-
</div>
57
-
Change the text with <code>ColumnChooserButtonText</code>, <code>ColumnChooserSearchPlaceholderText</code>, <code>ColumnChooserResetText</code>, and the other <code>ColumnChooser*Text</code> parameters.
<SectionSize="HeadingSize.H2"Name="Export to CSV"PageUrl="@pageUrl"Link="export-to-csv">
63
-
<divclass="mb-3">
64
-
An <b>Export CSV</b> button downloads every row that matches the current filters and sort, across all pages, with the columns people see, in their order.
65
-
<br />
66
-
<strong>How to use:</strong>
67
-
<divclass="content mb-2">
68
-
<ol>
69
-
<li>Set <code>AllowExport="true"</code> on the Grid, and optionally <code>ExportFileName</code>.</li>
70
-
<li>Give each exported column a <code>PropertyName</code>; its value is written with the grid's culture. Set <code>Exportable="false"</code> on columns such as actions.</li>
71
-
<li>With a <code>DataProvider</code>, return all matching rows when <code>PageNumber</code> and <code>PageSize</code> are 0. <code>request.ApplyTo(...)</code> already does.</li>
72
-
<li>Call <code>ExportToCsvAsync()</code> to export from your own button.</li>
73
-
</ol>
74
-
</div>
75
-
Text that starts with <code>=</code>, <code>+</code>, <code>-</code>, or <code>@@</code> is written with a leading apostrophe, so spreadsheet apps don't run it as a formula.
0 commit comments