This question is locked. New answers and comments are not allowed.
Hi i have a dataform and some buttons outside of the dataform which are used to open the dataform in the relevant mode. My problem is my add button opens the dataform in the edittemplate instead of the newitemtemplate.
This is my xaml for the dataform
I have seperate templates for the newitemtemplate and edittemplate. This is my code behind which opens the relevant template;
Can anyone see why my Add button will always open the dataform using the edittemplate. I have also tried changing the "AutoEdit" property to false, that didnt work either. Thanks
This is my xaml for the dataform
<
Telerik:RadDataForm
CurrentItem
=
"{Binding STAMemberDetailsReportViewDTO,Mode=TwoWay,NotifyOnValidationError=True,ValidatesOnDataErrors=True,ValidatesOnNotifyDataErrors=True}"
CommandButtonsVisibility
=
"Cancel,Commit"
x:Name
=
"_DetailForm"
Header
=
"Static Data - Member Details"
AutoGenerateFields
=
"False"
VerticalContentAlignment
=
"Stretch"
HorizontalContentAlignment
=
"Stretch"
NewItemTemplate
=
"{StaticResource memberDetailsNewItemTemplate}"
>
I have seperate templates for the newitemtemplate and edittemplate. This is my code behind which opens the relevant template;
private void ReceiveMessage(MessageArguments action)
{
switch (action.Command)
{
case MessageCommand.STAMemberAddDetailFormWindow:
STAMemberDetailViewModel vm = new STAMemberDetailViewModel();
_DetailForm.CurrentItem = null;
_DetailForm.ItemsSource = vm.STAMemberDetailsReportViewDTOs;
_DetailForm.AutoEdit = true;
_DetailForm.AddNewItem();
break;
case MessageCommand.STAMemberEditDetailFormWindow:
_DetailForm.BeginEdit();
break;
}
}
Can anyone see why my Add button will always open the dataform using the edittemplate. I have also tried changing the "AutoEdit" property to false, that didnt work either. Thanks