Skip to content

Commit 85afda7

Browse files
docs(grid): update info on nested classes
1 parent d9f3683 commit 85afda7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

knowledge-base/grid-bind-navigation-property-complex-object.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,17 @@ Data that you bind to the grid may have complex objects in its model, not only p
1616

1717
How do I use complex objects in my model and show navigation properties information in the grid?
1818

19+
## Notes
20+
21+
Generally, in such a case the grid must be bound to a parent class/interface that exposes all fields that its inheritors will have, so that the grid can show them. The grid cannot know what may be inherited and how its values relate to the base type it is bound to.
22+
23+
Thus, we recommend that you have all necessary fields in the base class and override them in child classes if needed, otherwise, return an empty string in the main class.
24+
25+
This will let the grid perform operations like sorting and filtering, that will otherwise break. You could implement the `ICopmarer` interface to allow sorting, but this can quickly become cumbersome with the more inheritance there is, and it may also couple the separate implementations.
26+
1927
## Solution
2028

21-
Use [Templates]({%slug components/grid/features/templates%}). For example:
29+
If simple display is sufficient, you can use [Templates]({%slug components/grid/features/templates%}). For example:
2230

2331
````CSHTML
2432
@using Telerik.Blazor

0 commit comments

Comments
 (0)