Skip to content

Commit 2185164

Browse files
Column Menu - Groupable and Reorderable (#1546)
* docs(grid): docs on filter menu buttons template * docs(grid): docs on filter menu buttons template * Update components/grid/templates/filter.md Co-authored-by: Yordan <[email protected]> * Update components/grid/templates/filter.md Co-authored-by: Yordan <[email protected]> * Update components/grid/templates/filter.md Co-authored-by: Yordan <[email protected]> * Update components/grid/templates/filter.md Co-authored-by: Yordan <[email protected]> * docs(columnmenu): add the reorderable and groupable * docs(columnmenu): fine tuning the article --------- Co-authored-by: Yordan <[email protected]>
1 parent 22c767a commit 2185164

File tree

1 file changed

+76
-14
lines changed

1 file changed

+76
-14
lines changed

components/grid/columns/menu.md

Lines changed: 76 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ The Grid allows you to setup a menu for its columns. It enables you to perform h
1515
>caption In this article:
1616
* [Basics](#basics)
1717
* [Features](#features)
18-
* [Sorting](#sorting)
18+
* [Column Chooser](#column-chooser)
1919
* [Filtering](#filtering)
20+
* [Groupable](#groupable)
2021
* [Frozen Columns](#frozen-columns)
21-
* [Column Chooser](#column-chooser)
2222
* [Sections](#sections)
23+
* [Sorting](#sorting)
24+
* [Reorderable](#reorderable)
2325
* [Example](#example)
2426
* [Notes](#notes)
2527

@@ -73,15 +75,26 @@ You can see the what the column menu can do and how to control its settings in t
7375

7476
To control the common features of the `Column Menu` use the `<GridColumnMenuSettings>` tag, nested inside the `<GridSettings>` tag:
7577

76-
* [Sorting](#sorting)
78+
* [Column Chooser](#column-chooser)
7779
* [Filtering](#filtering)
80+
* [Groupable](#groupable)
7881
* [Frozen Columns](#frozen-columns)
79-
* [Column Chooser](#column-chooser)
8082
* [Sections](#sections)
83+
* [Sorting](#sorting)
84+
* [Reorderable](#reorderable)
8185

82-
### Sorting
86+
### Column Chooser
87+
88+
The Column Chooser in the Column Menu and allows you to toggle the visiblity of Grid columns from the Column Menu. By the default all columns are visible under the `Columns` section of the Column Menu (click the Columns item to expand it).
89+
90+
The **Apply** button will set column visibility, according to the current checkbox values, and close the column menu. The **Reset** button will revert the checkbox values to their state when the column menu was opened. At this point the user can start over, click on **Apply** or click outside the column menu to close it.
91+
92+
![column chooser screenshot](images/column-menu-chooser-in-action.gif)
93+
94+
To disable the column chooser, set the `ShowColumnChooser` parameter of the `<GridColumnMenuSettings>` to `false`.
95+
96+
To hide a column from the Column Chooser set the `VisibleInColumnChooser` property of the column to `false`.
8397

84-
To remove the sorting option from the Column Menu set the `Sortable` parameter of the `GridColumnMenuSettings` tag to `false`.
8598

8699
### Filtering
87100

@@ -90,21 +103,21 @@ To control whether filtering is possible from the Column Menu set the `FilterMod
90103
* `None` - disables the filtering from the Column Menu. This is the recommended option if you use [`FilterRow` mode]({%slug grid-filter-row%}).
91104
* `FilterMenu` - enables a filter menu to apply filtering.
92105

93-
>important Do not mix [`FilterRow`]({%slug grid-filter-row%}) mode with [`FilterMenu`]({%slug grid-filter-menu%}) in the Column Menu. These filtering modes provide different UI and filter inputs. Combining them may mislead the user about the applied filters.
106+
### Groupable
94107

95-
### Frozen Columns
108+
To group the Grid from the Column Menu set the `Groupable` parameter of the `GridColumnMenuSettings` tag to `true`. This feature will group the component by the column you have opened the Column Menu from.
96109

97-
To disable locking and unlocking of a column from the Column Menu, set the `Lockable` parameter of the `GridColumnMenuSettings` to `false`.
110+
### Frozen Columns
98111

99-
### Column Chooser
112+
To disable locking and unlocking of a column from the Column Menu, set the `Lockable` parameter of the column to `false`.
100113

101-
The Column Chooser in the Column Menu allows you to toggle the visibility of the Grid columns from the Column Menu. By the default, all columns are visible under the `Columns` section of the Column Menu (click the Columns item to expand it).
114+
### Sorting
102115

103-
The **Apply** button will set the column visibility according to the current checkbox values and will close the column menu. The **Reset** button will revert the checkbox values to the state they had when the column menu was opened. At this point, the user can start over, click **Apply**, or click outside the column menu to close it.
116+
To remove the sorting option from the Column Menu, set the `Sortable` parameter of the `GridColumnMenuSettings` tag to `false`.
104117

105-
To disable the column chooser, set the `ShowColumnChooser` parameter of the `<GridColumnMenuSettings>` to `false`.
118+
### Reorderable
106119

107-
To hide a column from the Column Chooser set the `VisibleInColumnChooser` property of the column to `false`.
120+
To allow column reordering from the Column Column, set the `Reorderable` parameter of the `GridColumnMenuSettings` tag to `true`.
108121

109122
### Sections
110123

@@ -187,6 +200,55 @@ The columns in the Column Chooser are divided into sections. The Lockable option
187200
}
188201
````
189202

203+
### Example of Column Menu Features Settings
204+
205+
>caption Use the GridColumnMenuSettings tag to control the common features of the Column Menu, use column parameters to affect its relationship with the column menu
206+
207+
````CSHTML
208+
@* Disable filtering and locking columns, hide a column from the chooser (Team), disable the menu for a column (Name). *@
209+
210+
<TelerikGrid Data="@MyData"
211+
Pageable="true"
212+
PageSize="5"
213+
Groupable="true"
214+
FilterMode="@GridFilterMode.FilterMenu"
215+
Sortable="true"
216+
Reorderable="true"
217+
ShowColumnMenu="true">
218+
<GridSettings>
219+
<GridColumnMenuSettings Lockable="false"
220+
Groupable="true"
221+
Reorderable="true"
222+
FilterMode="@ColumnMenuFilterMode.None">
223+
</GridColumnMenuSettings>
224+
</GridSettings>
225+
<GridColumns>
226+
<GridColumn Field="@(nameof(SampleData.Id))" Width="80px" />
227+
<GridColumn Field="@(nameof(SampleData.Name))" Title="Employee Name" ShowColumnMenu="false" />
228+
<GridColumn Field="@(nameof(SampleData.Team))" Title="Team" VisibleInColumnChooser="false" />
229+
<GridColumn Field="@(nameof(SampleData.HireDate))" Title="Hire Date" />
230+
</GridColumns>
231+
</TelerikGrid>
232+
233+
@code {
234+
public IEnumerable<SampleData> MyData = Enumerable.Range(1, 30).Select(x => new SampleData
235+
{
236+
Id = x,
237+
Name = "name " + x,
238+
Team = "team " + x % 5,
239+
HireDate = DateTime.Now.AddDays(-x).Date
240+
});
241+
242+
public class SampleData
243+
{
244+
public int Id { get; set; }
245+
public string Name { get; set; }
246+
public string Team { get; set; }
247+
public DateTime HireDate { get; set; }
248+
}
249+
}
250+
````
251+
190252
## Notes
191253

192254
* Applying settings to a Grid column like `Filterable="false"`, `Sortable="false"`, `Lockable="false"` will take precendence over the common settings applied in the `<GridColumnMenuSettings>` and disable the above-mentioned functionalities for the corresponding column.

0 commit comments

Comments
 (0)