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: components/filemanager/data-binding/overview.md
+27-48Lines changed: 27 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -225,62 +225,41 @@ The FileManager has features that map to properties in the model. The following
225
225
}
226
226
````
227
227
228
-
The above model properties have the following meaning for the FileManager:
228
+
The following section describe the meaning of the model properties for the FileManager.
229
229
230
+
### Data Bindings
231
+
232
+
All [FileManager item features](#fileManager-item-features) map to model properties. The properties of a FileManager item match directly to a field of the component model. You define that relationship by providing the property name from which the corresponding information is taken. To do this, use the following parameters of the main `TelerikFileManager` tag:
|`IsDirectory`| Whether the item is a directory. If its value is `false` the item is considered a file and not a directory. |
241
-
|`DateCreated`| The creation date of the file. |
242
-
|`DateCreateUtc`| The creation date of the file in UTC. Required. |
243
-
|`DateModified`| The modification date of the file. |
244
-
|`DateModifiedUtc`| The modification date of the file in UTC. Required. |
245
-
|**Item relations**||
246
-
|`Id `| The unique identifier of the file. Required for [**binding to flat data**](slug:filemanager-data-binding-flat-data). |
247
-
|`ParentId`| Identifies the file's parent. Required for [**binding to flat data**](slug:filemanager-data-binding-flat-data). Set to `null` for root items. Do *not* use `ParentId` with hierarchical data. |
248
-
|`HasDirectories`| Determines whether the item has subdirectories. Required for binding to [**flat data**](slug:filemanager-data-binding-flat-data) If `true`, the directory will show an expand arrow. With [**hierarchical data**](slug:filemanager-data-binding-hierarchical-data), the FileManager renders expand icons based on `Directories`, but `HasDirectories` will take precedence. |
249
-
| `Directories` | Defines the item subdirectories. Required for [binding to **hierarchical data**](slug:filemanager-data-binding-hierarchical-data).
250
-
|`Items`| Defines all the subitems (directories and files) of the item. |
251
-
252
-
## Data Bindings
253
-
254
-
All [FileManager item features](#fileManager-item-features) map to model properties. The properties of a treeview item match directly to a field of the model the treeview is bound to. You provide that relationship by providing the name of the field from which the corresponding information is to be taken. To do this, in the main `TelerikFileManager` tag, use the parameters described below:
255
-
256
-
| FileManager Parameter | Default Value |
257
-
| --- | --- |
258
-
|**Item features**||
259
-
|`NameField`|`"Name"`|
260
-
|`SizeField`|`"Size"`|
261
-
|`PathField`|`"Path"`|
262
-
|`ExtensionField`|`"Extension"`|
263
-
|`IsDirectoryField`|`"IsDirectoryField"`|
264
-
|`DateCreatedField`|`"DateCreated"`|
265
-
|`DateCreateUtcField`|`"DateCreateUtc"`|
266
-
|`DateModifiedField`|`"DateModified"`|
267
-
|`DateModifiedUtcField`|`"DateModifiedUtc"`|
268
-
|**Item relations**||
269
-
|`IdField `|`"Id" `|
270
-
|`ParentIdField`|`"ParentId"`|
271
-
|`HasDirectoriesField`|`"HasDirectories"`|
272
-
|`DirectoriesField`|`"Directories"`|
273
-
|`EntriesField`|`"Entries"`|
274
-
275
-
>important Do not use `ParentId` with hierarchical data. This will confuse the FileManager that it is bound to flat data and the component may not render any items. If the model must have a `ParentId` property, set `ParentIdField` to a non-existent property.
236
+
| FileManager Parameter | Default Parameter Value <br /> (Model Property Name) | Model Property Type | Model Value Description |
237
+
| --- | --- | --- | --- |
238
+
|**Item features**||||
239
+
|`NameField`|`"Name"`|`string`| The name of the file or folder, excluding the extension. |
240
+
|`SizeField`|`"Size"`|`long`| The size of the file in bytes. |
241
+
|`PathField`|`"Path"`|`string`| The path to the item, including the name and extension. |
242
+
|`ExtensionField`|`"Extension"`|`string`| The item extension, starting with a dot `.`|
243
+
|`IsDirectoryField`|`"IsDirectoryField"`|`bool`| Whether the item is a folder. If `false`, it's treated as a file. |
244
+
|`DateCreatedField`|`"DateCreated"`|`DateTime`| The creation date of the file. |
245
+
|`DateCreateUtcField`|`"DateCreateUtc"`|`DateTime`| The creation date of the file in UTC. Required. |
246
+
|`DateModifiedField`|`"DateModified"`|`DateTime`| The modification date of the file. |
247
+
|`DateModifiedUtcField`|`"DateModifiedUtc"`|`DateTime`| The modification date of the file in UTC. Required. |
248
+
|**Item relations**||||
249
+
|`IdField `|`"Id" `| any | The unique identifier of the file. Required for [binding to flat data](slug:filemanager-data-binding-flat-data). |
250
+
|`ParentIdField`|`"ParentId"`| any | Identifies the item's parent. Required for [binding to flat data](slug:filemanager-data-binding-flat-data). Set to `null` for root items. Do not use `ParentId` with hierarchical data. |
251
+
|`HasDirectoriesField`|`"HasDirectories"`|`bool`| Determines whether the item has child folders. Required for [binding to flat data](slug:filemanager-data-binding-flat-data) If `true`, the folder will show an expand arrow in the TreeView. With [hierarchical data](slug:filemanager-data-binding-hierarchical-data), the FileManager renders expand icons based on `Directories`, but `HasDirectories` takes precedence. |
252
+
|`DirectoriesField`|`"Directories"`|`IEnumerable<TItem>`| The item's child folders. Required for [binding to hierarchical data](slug:filemanager-data-binding-hierarchical-data)|
253
+
|`ItemsField`|`"Items"`|`IEnumerable<TItem>`| The folder's child files. Required for [binding to hierarchical data](slug:filemanager-data-binding-hierarchical-data). |
254
+
255
+
>important Do not use `ParentId` with hierarchical data. This will confuse the FileManager that it is bound to flat data and the component may not render any items. If the model must have a `ParentId` property, set `ParentIdField` to a non-existent property name.
276
256
277
257
## Next Steps
278
258
279
-
Learn the different ways to provide data to a TreeView:
*[Use hierarchical data](slug:filemanager-data-binding-hierarchical-data) - each item holds its children in a nested property
259
+
Learn the different ways to provide data to a FileManager:
283
260
261
+
*[Use flat data](slug:filemanager-data-binding-flat-data), where all items at all levels represent a single collection.
262
+
*[Use hierarchical data](slug:filemanager-data-binding-hierarchical-data), where each folder item holds its child files and folders in nested properties.
0 commit comments