This is a migrated thread and some comments may be shown as answers.

Empty List Template

1 Answer 30 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
jen
Top achievements
Rank 1
jen asked on 17 Jun 2013, 02:21 PM
Is there any way to display a blank form/empty template when there are no items in the collection?

Currently the form displays the Read Only template, but no converters in that template will run if the current item is null.

My issue is I have a button in my Read Only template that I need to disable when the current item is null. I tried a data converter but it wont run. Ideally I'd prefer to not have any feilds shown when the current item is null.

Any suggestions?

1 Answer, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 20 Jun 2013, 12:58 PM
Hello,

Basically the main difference between the auto-generated fields and the customized DataTemplates is that auto-generated fields are generated every time when the CurrentItem changes. On the other hand the DataTemplates get switched between readonly/edit/add, but there is always one "active" template, which is bound to the current item. If you want to hide them, you can set the ReadOnlyTemplate to null, when current item is null. Alternatively you can try binding this button's IsEnabled property to RadDataForm's CurrentItem.

Regards,
Ivan Ivanov
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
DataForm
Asked by
jen
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Share this question
or