|
112 | 112 | #filter-menu-from-code
|
113 | 113 | @* This snippet shows how to set filtering state to the grid from your code
|
114 | 114 | Applies to the FilterMenu mode *@
|
115 |
| - |
| 115 | + |
116 | 116 | @using Telerik.DataSource;
|
117 | 117 |
|
118 | 118 | <TelerikButton ThemeColor="primary" OnClick="@SetGridFilter">set filtering from code</TelerikButton>
|
|
176 | 176 | }
|
177 | 177 | #end
|
178 | 178 |
|
179 |
| - |
180 | 179 | #filter-menu-default-filters
|
181 |
| ->note When the Grid `FilterMode` is `FilterMenu`, the component will create default `FilterDecriptor`s in its state for **all columns**. This allows filter templates to work seamlessly and with little code. If you want to alter filters for a column, you must either modify the existing descriptor, or replace it. Simply adding an additional `FilterDescriptor` will not show up in the UI, because the Grid uses the first descriptor for the given field for the filtering UI. Another implication is that the Grid state always contains filter descriptors, no matter if the user has filtered or not. Inactive filter descriptors are distinguished by their `null` `Value`. |
| 180 | + |
| 181 | +>note Until version `3.1.0`, there was a bug that made the component create default `FilterDecriptor`s in its state for **all columns** when `FilterMode` is `FilterMenu`, including when no filtering occurs at all. This side-effect allowed filter templates to work seamlessly and with little code. After version `3.1.0`, ths bug was fixed and empty `FilterDecriptor`s are not added to the state of the component if no filtering occurs (the way filter templates work is unchanged). |
| 182 | +
|
| 183 | +>note If you want to alter filters for a column, you must either modify the existing descriptor, or replace it. Simply adding an additional `FilterDescriptor` will not show up in the UI, because the Grid uses the first descriptor for the given field for the filtering UI. Another implication is that the Grid state always contains filter descriptors, no matter if the user has filtered or not. Inactive filter descriptors are distinguished by their `null` `Value`. |
182 | 184 |
|
183 | 185 | >caption Handling filter changes - unexpected addition that does not update the UI, replacement of one filter, replacecment of all filters
|
184 | 186 |
|
@@ -268,7 +270,7 @@ This flexibility lets you choose what behavior you want from the grid.
|
268 | 270 | // see the extension methods related to GetFiltersForMember in the adjacent code tab
|
269 | 271 | // create a new collection so we can iterate over it without it getting lost with the removal from the parent collection
|
270 | 272 | List<IFilterDescriptor> teamFilters = new List<IFilterDescriptor>(state.FilterDescriptors.GetFiltersForMember("Team"));
|
271 |
| - |
| 273 | +
|
272 | 274 | // remove the existing filters for the Team field from the current collection
|
273 | 275 | for (int i = 0; i < teamFilters.Count(); i++)
|
274 | 276 | {
|
@@ -509,10 +511,10 @@ public static class FilterExtensions
|
509 | 511 | GridState<MainModel> desiredState = new GridState<MainModel>()
|
510 | 512 | {
|
511 | 513 | //expand the first two rows
|
512 |
| - ExpandedItems = new List<MainModel> |
513 |
| - { |
514 |
| - salesTeamMembers[0], |
515 |
| - salesTeamMembers[1] |
| 514 | + ExpandedItems = new List<MainModel> |
| 515 | + { |
| 516 | + salesTeamMembers[0], |
| 517 | + salesTeamMembers[1] |
516 | 518 | }
|
517 | 519 | };
|
518 | 520 |
|
|
0 commit comments