This question is locked. New answers and comments are not allowed.
Hi.
I am implementing a DataForm, and insert a new item, when you cancel displays the following error.
"CancelEdit is not allowed during a transaction begun by addnew"
This is my code.
Please help me.
Best regards.
I am implementing a DataForm, and insert a new item, when you cancel displays the following error.
"CancelEdit is not allowed during a transaction begun by addnew"
This is my code.
<
telerik:RadWindow
x:Class
=
"Quest.TabelasBasicas.ConsultarPilar"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
xmlns:riacontrols
=
"clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices"
xmlns:rialocal
=
"clr-namespace:Quest.Web"
Header
=
"ConsultarPilar"
Height
=
"500"
Width
=
"600"
>
<
Grid
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"200"
></
RowDefinition
>
<
RowDefinition
Height
=
"*"
></
RowDefinition
>
</
Grid.RowDefinitions
>
<
Grid.Resources
>
<
DataTemplate
x:Key
=
"TemplateDataFormReadOnly"
>
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"250"
></
ColumnDefinition
>
<
ColumnDefinition
Width
=
"100"
></
ColumnDefinition
>
<
ColumnDefinition
Width
=
"100"
></
ColumnDefinition
>
</
Grid.ColumnDefinitions
>
<
telerik:DataFormDataField
Label
=
"Pilar"
DataMemberBinding
=
"{Binding descricaoPilar, Mode=OneWay}"
Grid.Column
=
"0"
LabelPosition
=
"Above"
Description
=
"Nome do Pilar"
>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
Label
=
"Peso"
DataMemberBinding
=
"{Binding peso, Mode=OneWay}"
Width
=
"100"
Grid.Column
=
"1"
LabelPosition
=
"Above"
Description
=
"Peso do Pilar"
>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
Label
=
"Pontos"
DataMemberBinding
=
"{Binding pontos,Mode=TwoWay}"
Width
=
"100"
Grid.Column
=
"2"
LabelPosition
=
"Above"
Description
=
"Pontos do Pilar"
>
</
telerik:DataFormDataField
>
</
Grid
>
</
DataTemplate
>
<
DataTemplate
x:Key
=
"TemplateDataForm"
>
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"250"
></
ColumnDefinition
>
<
ColumnDefinition
Width
=
"100"
></
ColumnDefinition
>
<
ColumnDefinition
Width
=
"100"
></
ColumnDefinition
>
</
Grid.ColumnDefinitions
>
<
telerik:DataFormDataField
Label
=
"Pilar"
Grid.Column
=
"0"
LabelPosition
=
"Above"
Description
=
"Nome do Pilar"
>
<
telerik:RadMaskedTextBox
MaskType
=
"None"
Value
=
"{Binding descricaoPilar, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}"
></
telerik:RadMaskedTextBox
>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
Label
=
"Peso"
Width
=
"100"
Grid.Column
=
"1"
LabelPosition
=
"Above"
Description
=
"Peso do Pilar"
>
<
telerik:RadMaskedTextBox
MaskType
=
"Numeric"
Culture
=
"pt-BR"
Grid.Row
=
"1"
TabIndex
=
"7"
Grid.Column
=
"1"
Margin
=
"2"
VerticalAlignment
=
"Center"
Height
=
"22"
MaskedText
=
"{Binding peso, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}"
Mask
=
"d"
/>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
Label
=
"Pontos"
Width
=
"100"
Grid.Column
=
"2"
LabelPosition
=
"Above"
Description
=
"Pontos do Pilar"
>
<
telerik:RadMaskedTextBox
MaskType
=
"Numeric"
Culture
=
"pt-BR"
Grid.Row
=
"1"
TabIndex
=
"7"
Grid.Column
=
"1"
Margin
=
"2"
VerticalAlignment
=
"Center"
Height
=
"22"
MaskedText
=
"{Binding pontos, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}"
Mask
=
"d"
/>
</
telerik:DataFormDataField
>
</
Grid
>
</
DataTemplate
>
</
Grid.Resources
>
<
riacontrols:DomainDataSource
LoadedData
=
"TelaDS_LoadedData"
x:Name
=
"TelaDS"
AutoLoad
=
"True"
QueryName
=
"GetPilar"
>
<
riacontrols:DomainDataSource.DomainContext
>
<
rialocal:QuestDomainContext
/>
</
riacontrols:DomainDataSource.DomainContext
>
</
riacontrols:DomainDataSource
>
<
telerik:RadDataForm
x:Name
=
"dtForm"
EditEnded
=
"dtForm_EditEnded"
EditEnding
=
"dtForm_EditEnding"
Margin
=
"2"
ItemsSource
=
"{Binding Data, ElementName=TelaDS}"
LabelPosition
=
"Above"
AutoGenerateFields
=
"False"
AutoEdit
=
"False"
AutoCommit
=
"False"
CancelButtonContent
=
"Cancelar"
CommitButtonContent
=
"Salvar"
ReadOnlyTemplate
=
"{StaticResource TemplateDataFormReadOnly}"
NewItemTemplate
=
"{StaticResource TemplateDataForm}"
>
</
telerik:RadDataForm
>
<
telerik:RadGridView
Grid.Row
=
"1"
Margin
=
"2"
ItemsSource
=
"{Binding Data, ElementName=TelaDS}"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
Header
=
"Pilar"
DataMemberBinding
=
"{Binding descricaoPilar, Mode=OneWay}"
/>
<
telerik:GridViewDataColumn
Header
=
"Peso"
DataMemberBinding
=
"{Binding Peso, Mode=OneWay}"
/>
<
telerik:GridViewDataColumn
Header
=
"Pontos"
DataMemberBinding
=
"{Binding Pontos, Mode=OneWay}"
/>
<
telerik:GridViewDataColumn
Header
=
"Status"
DataMemberBinding
=
"{Binding status, Mode=OneWay}"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
</
Grid
>
</
telerik:RadWindow
>
Please help me.
Best regards.