I have a RadDataForm that's using a custom DataFormCommandProvider - pretty much lifted from the documentation. However, as soon as I assign my custom provider to the "CommandProvider" property to the RadDataForm, the VS designer places an error panel over the top of my rendered control with the following message:
The project builds and runs fine, and the custom command provider works as expected. However, the designer definitely has problems with it for some reason. Here is a XAML code (snippet) for the RadDataForm:
And the source for the CustomCommandProvider class (again, pretty much straight from the docs):
How can I eliminate the VS designer error so I can *see* my control instead of the error message?
Jeff
"An object of the type "TruNest.Client.CustomCommandProvider" cannot be applied to a property that expects the type "Telerik.Windows.Controls.ICommandProvider".
The project builds and runs fine, and the custom command provider works as expected. However, the designer definitely has problems with it for some reason. Here is a XAML code (snippet) for the RadDataForm:
<UserControl.Resources>
<local:CustomCommandProvider x:Key=
"CustomProvider"
/>
</UserControl.Resources>
<telerik:RadDataForm x:Name=
"dataForm"
HorizontalAlignment=
"Stretch"
VerticalAlignment=
"Stretch"
AutoGeneratingField=
"dataForm_AutoGeneratingField"
CommandButtonsVisibility=
"All"
CommandProvider=
"{StaticResource CustomProvider}"
EditEnded=
"dataForm_EditEnded"
IsEnabled=
"{Binding IsEnabled}"
ItemsSource=
"{Binding TableData}"
/>
And the source for the CustomCommandProvider class (again, pretty much straight from the docs):
using
Telerik.Windows.Controls;
using
Telerik.Windows.Controls.Data.DataForm;
namespace
TruNest.Client
{
public
class
CustomCommandProvider : DataFormCommandProvider
{
public
CustomCommandProvider()
:
base
(
null
)
{
}
public
CustomCommandProvider(RadDataForm dataForm)
:
base
(dataForm)
{
this
.DataForm = dataForm;
}
protected
override
void
CommitEdit()
{
bool
? dialogResult =
null
;
RadWindow.Confirm(
new
DialogParameters()
{
Header =
"Confirm"
,
Content =
"Commit all changes?"
,
Closed = (confirmDialog, eventArgs) =>
{
dialogResult = eventArgs.DialogResult;
}
});
if
((
bool
)dialogResult)
{
this
.DataForm.CommitEdit();
}
}
protected
override
void
CancelEdit()
{
bool
? dialogResult =
null
;
RadWindow.Confirm(
new
DialogParameters()
{
Header =
"Confirm"
,
Content =
"Cancel all changes?"
,
Closed = (confirmDialog, eventArgs) =>
{
dialogResult = eventArgs.DialogResult;
}
});
if
((
bool
)dialogResult)
{
this
.DataForm.CancelEdit();
}
}
protected
override
bool
CanDeleteExecute()
{
return
false
;
}
protected
override
bool
CanAddNewExecute()
{
return
false
;
}
}
}
How can I eliminate the VS designer error so I can *see* my control instead of the error message?
Jeff