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
Copy file name to clipboardExpand all lines: docs-aspnet/html-helpers/data-management/grid/faq.md
+226-6Lines changed: 226 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,17 @@ This article lists some of the most frequently asked questions when working with
15
15
16
16
By default, the Telerik UI Grid for {{ site.framework }} encodes the HTML entities that are included in its data. To prevent this, call the [`Encoded`](/api/Kendo.Mvc.UI.Fluent/GridBoundColumnBuilder#formatsystemstring) method and pass `false` as its argument.
17
17
18
+
```HtmlHelper
18
19
columns.Bound(o => o.Description).Encoded(false);
20
+
```
21
+
{% if site.core %}
22
+
```TagHelper
23
+
<columns>
24
+
<column field="Description" encoded="false">
25
+
</column>
26
+
</columns>
27
+
```
28
+
{% endif %}
19
29
20
30
## How can I customize the way properties are displayed in Grid-bound columns?
21
31
@@ -59,12 +69,20 @@ Use the `ClientTemplate` method. The value should be a string, which represents
59
69
60
70
{% endif %}
61
71
62
-
```HtmlHelper
63
-
.Columns(columns =>
64
-
{
65
-
columns.Bound(p => p.Title).ClientTemplate("<strong>#: Title #</strong>");
66
-
})
67
-
```
72
+
```HtmlHelper
73
+
.Columns(columns =>
74
+
{
75
+
columns.Bound(p => p.Title).ClientTemplate("<strong>#: Title #</strong>");
76
+
})
77
+
```
78
+
{% if site.core %}
79
+
```TagHelper
80
+
<columns>
81
+
<column field="Title" template="<strong>#: Title #</strong>">
82
+
</column>
83
+
</columns>
84
+
```
85
+
{% endif %}
68
86
69
87
## How can I apply conditional logic to client column templates?
70
88
@@ -81,6 +99,15 @@ The following example demonstrates the conditions in the `ClientTemplate`.
> The property names of the object that are passed as additional data must not match the property names in the `ViewModel`. Otherwise, the MVC binder will not recognize which property corresponds to the `ViewModel` and which to the additional `data` object.
311
443
@@ -391,6 +523,20 @@ The following example demonstrates how to handle errors in the Ajax binding mode
var message = "The following errors have occurred:\n";
649
+
650
+
$.each(e.errors, function(key, value) {
651
+
if (value.errors) {
652
+
message += value.errors.join("\n");
653
+
}
654
+
});
655
+
656
+
alert(message);
657
+
}
658
+
}
659
+
</script>
660
+
```
661
+
{% endif %}
485
662
## How can I create custom pop-up editors?
486
663
487
664
The Kendo UI Grid for {{ site.framework }} uses the `Html.EditorForModel` to create the editing form. This method relies on {{ site.framework }} editor templates. To create a custom editor template, create a partial view under the `~/Views/Shared/EditorTemplates` folder and specify it through the `UIHint` attribute.
@@ -510,6 +687,22 @@ The following example demonstrates how to specify default property values.
> The `ReadOnly` and `Editable` settings work only in in-line and in-cell editing modes. Use a custom popup editor if you want to exclude certain properties from the editor form.
567
775
@@ -580,6 +788,12 @@ To validate a date by using the Kendo UI DateTimePicker:
0 commit comments