Skip to content

Commit ac778a6

Browse files
committed
Sync with Kendo UI Professional
1 parent 4d52dfd commit ac778a6

File tree

5 files changed

+274
-4
lines changed

5 files changed

+274
-4
lines changed

docs-aspnet/html-helpers/data-management/grid/columns/widths.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ Change the `table-layout` to `fixed`.
4040

4141
To remove the misalignment of the columns and headers when the Grid is resized, provide at least one column without a specified width so that it can freely adjust.
4242

43+
## KB Articles on Grid Column Widths
44+
45+
* [Auto Fit Column Width of the Grid for {{ site.framework}}]({% slug grid-autofit-all-columns-width %})
46+
* [Find Out More in the Knowledge Base](/knowledge-base)
47+
4348
## See Also
4449

45-
* [Knowledge Base Section](/knowledge-base)
4650
* [Server-Side API](/api/grid)
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
title: Allowing ContextMenu Commands for Files Only in ListView
3+
description: Learn how to display context menu commands only for files and not folders in the right pane of the {{ site.product }} component.
4+
type: how-to
5+
page_title: Displaying ContextMenu Commands for Files Only in {{ site.product }} ListView | {{ site.product }}
6+
slug: filemanager-displaying-contextmenu-commands-for-files-only-in-listview
7+
tags: filemanager, asp.net mvc, asp.net core, contextmenu, commands, files, folders, listview
8+
res_type: kb
9+
---
10+
11+
## Environment
12+
13+
| Product | Version |
14+
|---------|---------|
15+
| Progress® {{ site.product }} | 2023.3.1114 |
16+
17+
## Description
18+
19+
How can I configure the {{ site.product }} to only allow a context menu command to work for files in the right pane?
20+
21+
## Solution
22+
23+
To display ContextMenu commands only for files and not folders in the right pane/ListView of the {{ site.product_short }} FileManager, follow the steps below:
24+
25+
1. Define the [ContextMenu's Open event handler.](https://docs.telerik.com/kendo-ui/api/javascript/ui/contextmenu/events/open)
26+
2. Check if the target is the TreeView (left pane) by determining if it [has the `k-treeview-item` class.](https://api.jquery.com/hasClass/)
27+
3. Determine if the target is a folder by checking if [the `k-svg-i-folder` icon exists.](https://api.jquery.com/find/)
28+
4. Make a reference to the specific command item [using the data attribute.](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors)
29+
5. Conditionally [disable the listItem from the Kendo UI ContextMenu.](https://docs.telerik.com/kendo-ui/api/javascript/ui/contextmenu/methods/enable)
30+
31+
```View_HtmlHelper
32+
@(Html.Kendo().FileManager().Name("filemanager")
33+
.ContextMenu(context => context.Items(items =>
34+
{
35+
items.Add("rename");
36+
}).Open("onOpen")) //Add Open Event
37+
//...
38+
)
39+
```
40+
41+
```javascript
42+
function onOpen(e) {
43+
//Check if the target is from the TreeView
44+
var isTreeView = $(e.target).hasClass("k-treeview-item");
45+
46+
//find the folder
47+
var isFolder = $(e.target).find("span.k-svg-i-folder").length;
48+
49+
//find the command List Item - rename in this case
50+
var renameCommand = $(e.sender.wrapper).find("li[data-command='RenameCommand']");
51+
52+
//If it's a folder or TreeView Item
53+
if (isFolder || isTreeView) {
54+
55+
//Disable the listItem
56+
this.enable(renameCommand , false);
57+
} else {
58+
59+
//Otherwise, enable it
60+
this.enable(renameCommand , true);
61+
}
62+
}
63+
```
64+
Please refer to [this sample](https://netcorerepl.telerik.com/GyYbFMGv27nRO4NS19) for a visual representation of the approach.
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
---
2+
title: Automatically Fit Width of Grid Columns to Show All Data
3+
description: Learn how to automatically fit the width of all {{ site.framework }} columns to show all data.
4+
type: how-to
5+
page_title: Automatically Fit Column Width to Show All Data - {{ site.framework }} Data Grid
6+
slug: grid-autofit-all-columns-width
7+
tags: grid, autofit, auto, fit, automatically, columns, width, show, all, data
8+
ticketid: 1148885
9+
res_type: kb
10+
---
11+
12+
## Environment
13+
14+
<table>
15+
<tr>
16+
<td>Product</td>
17+
<td>Progress® {{ site.framework }} Grid</td>
18+
<td>Version</td>
19+
<td>2023.3.1114 </td>
20+
</tr>
21+
</table>
22+
23+
## Description
24+
25+
How can I have the columns of a {{ site.framework }} Grid automatically fit their width to accommodate their content?
26+
27+
## Solution
28+
29+
1. Subscribe to the [`DataBound`](https://docs.telerik.com/{{ site.platform }}/api/kendo.mvc.ui.fluent/grideventbuilder#databoundsystemstring) event of the Grid.
30+
1. Loop through the Grid columns and pass the column index to the client-side [`autoFitColumn`](https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/methods/autofitcolumn) method.
31+
32+
```HtmlHelper
33+
@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.ProductViewModel>()
34+
.Name("Grid")
35+
.Columns(columns =>
36+
{
37+
columns.Bound(p => p.ProductName).Title("Product Name").Width(320);
38+
columns.Bound(p => p.UnitPrice).Title("Unit Price").Width(150);
39+
columns.Bound(p => p.UnitsInStock).Title("Units In Stock").Width(150).MinScreenWidth(800);
40+
columns.Bound(p => p.UnitsOnOrder).Title("Units On Order").Width(150).MinScreenWidth(800);
41+
columns.Bound(p => p.Discontinued).Width(130);
42+
columns.Command(command => command.Destroy()).Width(160);
43+
})
44+
.Pageable()
45+
.Events(events => events.DataBound("onDataBound"))
46+
.DataSource(dataSource => dataSource
47+
.Ajax()
48+
.PageSize(20)
49+
.Model(model =>
50+
{
51+
model.Id(p => p.ProductID);
52+
model.Field(p => p.ProductID).Editable(false);
53+
})
54+
.Create("Products_Create", "Grid")
55+
.Read("Products_Read", "Grid")
56+
.Update("Products_Update", "Grid")
57+
.Destroy("Products_Destroy", "Grid")
58+
)
59+
)
60+
```
61+
```TagHelper
62+
@addTagHelper *, Kendo.Mvc
63+
64+
<kendo-grid name="Grid" navigatable="true" on-data-bound="onDataBound">
65+
<datasource type="DataSourceTagHelperType.Ajax" page-size="20">
66+
<schema data="Data" total="Total">
67+
<model id="ProductID">
68+
<fields>
69+
<field name="ProductID" type="number" editable="false"></field>
70+
<field name="ProductName" type="string"></field>
71+
<field name="UnitPrice" type="number"></field>
72+
<field name="UnitsInStock" type="number"></field>
73+
<field name="Discontinued" type="boolean"></field>
74+
</fields>
75+
</model>
76+
</schema>
77+
<transport>
78+
<read url="@Url.Action("Products_Read", "Grid")"/>
79+
<update url="@Url.Action("Products_Update", "Grid")"/>
80+
<create url="@Url.Action("Products_Create", "Grid")"/>
81+
<destroy url="@Url.Action("Products_Destroy", "Grid")"/>
82+
</transport>
83+
</datasource>
84+
<columns>
85+
<column field="ProductName" width="320" title="Product Name"/>
86+
<column field="UnitPrice" title="Unit Price" width="150"/>
87+
<column field="UnitsInStock" title="Units In Stock" width="150" min-screen-width="800"/>
88+
<column field="UnitsOnOrder" title="Units On Order" width="150" min-screen-width="800"/>
89+
<column field="Discontinued" width="130"/>
90+
<column width="160">
91+
<commands>
92+
<column-command text="Delete" name="destroy"></column-command>
93+
</commands>
94+
</column>
95+
</columns>
96+
<pageable enabled="true"/>
97+
</kendo-grid>
98+
```
99+
```JavaScript
100+
function onDataBound(e){
101+
for (var i = 0; i < this.columns.length; i++) {
102+
this.autoFitColumn(i);
103+
}
104+
}
105+
```
106+
107+
{% if site.core %}
108+
## Explore the solution in REPL
109+
110+
You can continue experimenting with the code sample above by running it in the Telerik REPL server playground:
111+
112+
* [Sample code with the Autofit Grid Columns HtmlHelper](https://netcorerepl.telerik.com/QokFxbby203ttLSO02)
113+
* [Sample code with the Autofit Grid Columns TagHelper](https://netcorerepl.telerik.com/QouvHPbI17sJDzOo56)
114+
115+
{% endif %}
116+
117+
## Notes
118+
119+
Applying auto-sizing to all columns of the Grid is a resource intensive operation. Depending on the number of configured columns, it may cause performance issues on the client-side.
120+
121+
## More {{ site.framework }} Grid Resources
122+
123+
* [{{ site.framework }} Grid Documentation](https://docs.telerik.com/aspnet-core/html-helpers/data-management/grid/overview)
124+
125+
* [{{ site.framework }} Grid Demos](https://demos.telerik.com/{{ site.platform }}/grid/index)
126+
127+
{% if site.core %}
128+
* [{{ site.framework }} Grid Product Page](https://www.telerik.com/aspnet-core-ui/grid)
129+
130+
* [Telerik UI for {{ site.framework }} Video Onboarding Course (Free for trial users and license holders)]({%slug virtualclass_uiforcore%})
131+
132+
* [Telerik UI for {{ site.framework }} Forums](https://www.telerik.com/forums/aspnet-core-ui)
133+
134+
{% else %}
135+
* [{{ site.framework }} Grid Product Page](https://www.telerik.com/aspnet-mvc/grid)
136+
137+
* [Telerik UI for {{ site.framework }} Video Onboarding Course (Free for trial users and license holders)]({%slug virtualclass_uiformvc%})
138+
139+
* [Telerik UI for {{ site.framework }} Forums](https://www.telerik.com/forums/aspnet-mvc)
140+
{% endif %}
141+
142+
## See Also
143+
144+
* [Appearance of the Grid](https://docs.telerik.com/aspnet-core/html-helpers/data-management/grid/appearance/width)
145+
* [Server-Side API Reference of the Grid for {{ site.framework }}](https://docs.telerik.com/{{ site.platform }}/api/grid)
146+
* [Telerik UI for {{ site.framework }} Breaking Changes]({%slug breakingchanges_2023%})

docs-aspnet/styles-and-layout/less-themes/less-themes-migration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ The following table contains the name of the LESS theme and its SASS counterpart
6464
| `Black` | `Classic - Opal Dark` | Available | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/classic/classic-opal-dark.css |
6565
| `Blue Opal` | `Classic - Opal` | Available | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/classic/classic-opal.css |
6666
| `Silver` | `Classic - Silver` | Available | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/classic/classic-silver.css |
67-
| `Metro` | `Classic - Metro` | In Research | TBA |
68-
| `Metro Black` | `Classic - Metro Dark` | In Research | TBA |
69-
| `Moonlight` | `Classic - Moonlight` | In Research | TBA |
67+
| `Metro` | `Classic - Metro` | Available | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/classic/classic-metro.css |
68+
| `Metro Black` | `Classic - Metro Dark` | Available | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/classic/classic-metro-dark.css |
69+
| `Moonlight` | `Classic - Moonlight` | Available | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/classic/classic-moonlight.css |
7070
| `Bootstrap 3` | `Bootstrap - Bootstrap 3` | Available | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/bootstrap/bootstrap-3.css |
7171
| `Bootstrap 3 Dark` | `Bootstrap - Bootstrap 3 Dark` | Available | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/bootstrap/bootstrap-3-dark.css |
7272
| `Flat` | `Bootstrap - Turquoise` | Available | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/bootstrap/bootstrap-turquoise.css |

docs-aspnet/styles-and-layout/sass-themes/swatches.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,62 @@ The following example showcases several swatches:
4545
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/material/material-nova.css" />
4646
```
4747

48+
The following table contains a list of the available SASS Theme Swatches:
49+
50+
| Sass Theme | Sass Theme CDN
51+
|:--- |:---
52+
| `Default - Main` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/default/default-main.css |
53+
| `Default - Main Dark` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/default/default-main-dark.css |
54+
| `Default - Blue` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/default/default-blue.css |
55+
| `Default - Green` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/default/default-green.css |
56+
| `Default - Ocean Blue` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/default/default-ocean-blue.css |
57+
| `Default - Ocean Blue Accessibility` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/default/default-ocean-blue-a11y.css |
58+
| `Default - Orange` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/default/default-orange.css |
59+
| `Default - Purple` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/default/default-purple.css |
60+
| `Default - Turquoise` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/default/default-turquoise.css |
61+
| `Default - Urban` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/default/default-urban.css |
62+
| `Classic - Main` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/classic/classic-main.css |
63+
| `Classic - Main Dark` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/classic/classic-main-dark.css |
64+
| `Classic - Opal Dark` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/classic/classic-opal-dark.css |
65+
| `Classic - Opal` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/classic/classic-opal.css |
66+
| `Classic - Silver` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/classic/classic-silver.css |
67+
| `Classic - Silver Dark` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/classic/classic-silver-dark.css |
68+
| `Classic - Metro` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/classic/classic-metro.css |
69+
| `Classic - Metro Dark` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/classic/classic-metro-dark.css |
70+
| `Classic - Moonlight` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/classic/classic-moonlight.css |
71+
| `Classic - Lavender Dark` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/classic/classic-lavender-dark.css |
72+
| `Classic - Lavender Light` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/classic/classic-lavender.css |
73+
| `Classic - Green` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/classic/classic-green.css |
74+
| `Classic - Green Dark` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/classic/classic-green-dark.css |
75+
| `Classic - Uniform` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/classic/classic-uniform.css |
76+
| `Bootstrap - Main` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/bootstrap/bootstrap-main.css |
77+
| `Bootstrap - Main Dark` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/bootstrap/bootstrap-main-dark.css |
78+
| `Bootstrap - Bootstrap 3` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/bootstrap/bootstrap-3.css |
79+
| `Bootstrap - Bootstrap 3 Dark` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/bootstrap/bootstrap-3-dark.css |
80+
| `Bootstrap - Bootstrap 4` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/bootstrap/bootstrap-4.css |
81+
| `Bootstrap - Bootstrap 4 Dark` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/bootstrap/bootstrap-4-dark.css |
82+
| `Bootstrap - Nordic` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/bootstrap/bootstrap-nordic.css |
83+
| `Bootstrap - Turquoise` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/bootstrap/bootstrap-turquoise.css |
84+
| `Bootstrap - Turquoise Dark` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/bootstrap/bootstrap-turquoise-dark.css |
85+
| `Bootstrap - Urban` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/bootstrap/bootstrap-urban.css |
86+
| `Bootstrap - Vintage` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/bootstrap/bootstrap-vintage.css |
87+
| `Material - Main` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/material/material-main.css |
88+
| `Material - Main Dark` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/material/material-dark.css |
89+
| `Material - Nova` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/material/material-nova.css |
90+
| `Material - Arctic` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/material/material-arctic.css |
91+
| `Material - Aqua Dark` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/material/material-aqua-dark.css |
92+
| `Material - Burnt Teal` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/material/material-burnt-teal.css |
93+
| `Material - Eggplant` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/material/material-eggplant.css |
94+
| `Material - Lime` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/material/material-lime.css |
95+
| `Material - Lime Dark` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/material/material-lime-dark.css |
96+
| `Material - Pacific` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/material/material-pacific.css |
97+
| `Material - Pacific Dark` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/material/material-pacific-dark.css |
98+
| `Material - Sky` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/material/material-sky.css |
99+
| `Material - Sky Dark` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/material/material-sky-dark.css |
100+
| `Material - Smoke` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/material/material-smoke.css |
101+
| `Fluent - Main` | https://kendo.cdn.telerik.com/themes/{{ site.themesCdnVersion }}/fluent/fluent-main.css |
102+
103+
48104
## Using Built-in Swatches
49105

50106
To use the Telerik Themes infrastructure for building and creating swatches, first set up the Kendo Themes repository:

0 commit comments

Comments
 (0)