Hello everyone,
I replace my dataform to Telerik dataform control but it doesn rendered. Here is the Xaml code
When I add the readonlytemplate , it crashes. I can't find any error in the script.
I get the following error in the design view:
Thank you in advance for your help.
Kam
I replace my dataform to Telerik dataform control but it doesn rendered. Here is the Xaml code
<
UserControl
x:Class
=
"BijanAdmin.controls.ctrlnewcompany"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
xmlns:telerikGrid
=
"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Data"
xmlns:Riacontrols
=
"clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices"
xmlns:ds
=
"clr-namespace:BijansWeb.Services.Admin"
mc:Ignorable
=
"d"
Background
=
"Transparent"
>
<
UserControl.Resources
>
<
DataTemplate
x:Key
=
"readtemplate"
>
<
StackPanel
Orientation
=
"Vertical"
>
<
telerik:DataFormDataField
Label
=
"Company Name:"
DataMemberBinding
=
"{Binding Company}"
LabelPosition
=
"Top"
>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
Label
=
"Address 1:"
DataMemberBinding
=
"{Binding Add1}"
LabelPosition
=
"Top"
>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
Label
=
"Address 2:"
DataMemberBinding
=
"{Binding Add2}"
LabelPosition
=
"Top"
>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
Label
=
"Address 3:"
DataMemberBinding
=
"{Binding Add3}"
LabelPosition
=
"Top"
>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
Label
=
"City:"
DataMemberBinding
=
"{Binding City}"
LabelPosition
=
"Top"
>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
Label
=
"Postcode:"
DataMemberBinding
=
"{Binding Postcode}"
LabelPosition
=
"Top"
>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
Label
=
"Telephone:"
DataMemberBinding
=
"{Binding Telephone}"
LabelPosition
=
"Top"
>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
Label
=
"Fax:"
DataMemberBinding
=
"{Binding Fax}"
LabelPosition
=
"Top"
>
</
telerik:DataFormDataField
>
</
StackPanel
>
</
DataTemplate
>
<
DataTemplate
x:Key
=
"editonlytemplate"
>
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
></
ColumnDefinition
>
<
ColumnDefinition
></
ColumnDefinition
>
</
Grid.ColumnDefinitions
>
<
Grid.RowDefinitions
>
<
RowDefinition
></
RowDefinition
>
<
RowDefinition
></
RowDefinition
>
<
RowDefinition
></
RowDefinition
>
<
RowDefinition
></
RowDefinition
>
<
RowDefinition
></
RowDefinition
>
<
RowDefinition
></
RowDefinition
>
<
RowDefinition
></
RowDefinition
>
<
RowDefinition
></
RowDefinition
>
<
RowDefinition
></
RowDefinition
>
</
Grid.RowDefinitions
>
<
telerik:DataFormDataField
Label
=
"Company Name:"
DataMemberBinding
=
"{Binding Company, Mode=TwoWay}"
Grid.Row
=
"1"
Grid.Column
=
"0"
LabelPosition
=
"Top"
>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
Label
=
"Address 1:"
DataMemberBinding
=
"{Binding Add1, Mode=TwoWay}"
Grid.Row
=
"2"
Grid.Column
=
"0"
LabelPosition
=
"Top"
>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
Label
=
"Address 2:"
DataMemberBinding
=
"{Binding Add2, Mode=TwoWay}"
Grid.Row
=
"3"
Grid.Column
=
"0"
LabelPosition
=
"Top"
>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
Label
=
"Address 3:"
DataMemberBinding
=
"{Binding Add3, Mode=TwoWay}"
Grid.Row
=
"4"
Grid.Column
=
"0"
LabelPosition
=
"Top"
>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
Label
=
"City:"
DataMemberBinding
=
"{Binding City, Mode=TwoWay}"
Grid.Row
=
"5"
Grid.Column
=
"0"
LabelPosition
=
"Top"
>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
Label
=
"Postcode:"
DataMemberBinding
=
"{Binding Postcode, Mode=TwoWay}"
Grid.Row
=
"6"
Grid.Column
=
"0"
LabelPosition
=
"Top"
>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
Label
=
"Telephone:"
DataMemberBinding
=
"{Binding Telephone, Mode=TwoWay}"
Grid.Row
=
"1"
Grid.Column
=
"1"
LabelPosition
=
"Top"
>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
Label
=
"Fax:"
DataMemberBinding
=
"{Binding Fax, Mode=TwoWay}"
Grid.Row
=
"2"
Grid.Column
=
"1"
LabelPosition
=
"Top"
>
</
telerik:DataFormDataField
>
</
Grid
>
</
DataTemplate
>
<
DataTemplate
x:Key
=
"newonlytemplate"
>
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
></
ColumnDefinition
>
<
ColumnDefinition
></
ColumnDefinition
>
</
Grid.ColumnDefinitions
>
<
Grid.RowDefinitions
>
<
RowDefinition
></
RowDefinition
>
<
RowDefinition
></
RowDefinition
>
<
RowDefinition
></
RowDefinition
>
<
RowDefinition
></
RowDefinition
>
<
RowDefinition
></
RowDefinition
>
<
RowDefinition
></
RowDefinition
>
<
RowDefinition
></
RowDefinition
>
<
RowDefinition
></
RowDefinition
>
<
RowDefinition
></
RowDefinition
>
</
Grid.RowDefinitions
>
<
telerik:DataFormDataField
x:Name
=
"txtnewconew"
DataMemberBinding
=
"{Binding Company, Mode=TwoWay}"
Label
=
"Company Name:"
Grid.Row
=
"1"
Grid.Column
=
"0"
LabelPosition
=
"Top"
>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
x:Name
=
"txtadd1new"
DataMemberBinding
=
"{Binding Add1, Mode=TwoWay}"
Label
=
"Address 1:"
Grid.Row
=
"2"
Grid.Column
=
"0"
LabelPosition
=
"Top"
>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
x:Name
=
"txtadd2new"
DataMemberBinding
=
"{Binding Add2, Mode=TwoWay}"
Label
=
"Address 2:"
Grid.Row
=
"3"
Grid.Column
=
"0"
LabelPosition
=
"Top"
>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
x:Name
=
"txtadd3new"
DataMemberBinding
=
"{Binding Add3, Mode=TwoWay}"
Label
=
"Address 3:"
Grid.Row
=
"4"
Grid.Column
=
"0"
LabelPosition
=
"Top"
>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
x:Name
=
"txtcitynew"
DataMemberBinding
=
"{Binding City, Mode=TwoWay}"
Label
=
"City:"
Grid.Row
=
"5"
Grid.Column
=
"0"
LabelPosition
=
"Top"
>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
x:Name
=
"txtpcodenew"
DataMemberBinding
=
"{Binding Postcode, Mode=TwoWay}"
Label
=
"Postcode:"
Grid.Row
=
"6"
Grid.Column
=
"0"
LabelPosition
=
"Top"
>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
x:Name
=
"txttelnew"
DataMemberBinding
=
"{Binding Telephone, Mode=TwoWay}"
Label
=
"Telephone:"
Grid.Row
=
"1"
Grid.Column
=
"1"
LabelPosition
=
"Top"
>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
x:Name
=
"txtfaxnew"
DataMemberBinding
=
"{Binding Fax, Mode=TwoWay}"
Label
=
"Fax:"
Grid.Row
=
"2"
Grid.Column
=
"1"
LabelPosition
=
"Top"
>
</
telerik:DataFormDataField
>
</
Grid
>
</
DataTemplate
>
</
UserControl.Resources
>
<
Grid
x:Name
=
"LayoutRoot"
Background
=
"Transparent"
Margin
=
"0"
Height
=
"500"
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"45"
/>
<
RowDefinition
Height
=
"354*"
/>
<
RowDefinition
Height
=
"36*"
/>
<
RowDefinition
Height
=
"45"
/>
</
Grid.RowDefinitions
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"10"
></
ColumnDefinition
>
<
ColumnDefinition
Width
=
"55"
></
ColumnDefinition
>
<
ColumnDefinition
Width
=
"514"
/>
<
ColumnDefinition
Width
=
"7*"
></
ColumnDefinition
>
<
ColumnDefinition
/>
</
Grid.ColumnDefinitions
>
<
Riacontrols:DomainDataSource
x:Name
=
"bijanco"
QueryName
=
"GetBijans"
AutoLoad
=
"True"
LoadSize
=
"10"
>
<
Riacontrols:DomainDataSource.DomainContext
>
<
ds:BijanContext
></
ds:BijanContext
>
</
Riacontrols:DomainDataSource.DomainContext
>
</
Riacontrols:DomainDataSource
>
<
Border
Grid.Column
=
"1"
Grid.ColumnSpan
=
"3"
Grid.RowSpan
=
"4"
Style
=
"{StaticResource BodyBorderStyle}"
></
Border
>
<!--<Border Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="6" Grid.RowSpan="23" CornerRadius="10" Background="SlateGray" Opacity="0.5"></Border>-->
<
telerik:RadDataForm
x:Name
=
"frmcompany"
telerik:Theming.Theme
=
"Office_Blue"
Grid.Row
=
"1"
Grid.Column
=
"1"
Grid.ColumnSpan
=
"3"
ItemsSource
=
"{Binding bijanco, Mode=TwoWay}"
AutoGenerateFields
=
"false"
Background
=
"Transparent"
BorderBrush
=
"Transparent"
ReadOnlyTemplate
=
"{StaticResource readtemplate}"
EditTemplate
=
"{StaticResource editonlytemplate}"
NewItemTemplate
=
"{StaticResource newonlytemplate}"
Margin
=
"1,1,0,0"
HorizontalAlignment
=
"Left"
VerticalAlignment
=
"Top"
RenderTransformOrigin
=
"0.5,0.5"
Width
=
"661"
Height
=
"405"
AddingNewItem
=
"frmcompany_AddingNewItem"
EditEnded
=
"frmcompany_EditEnded"
DeletingItem
=
"frmcompany_DeletingItem"
Grid.RowSpan
=
"2"
>
</
telerik:RadDataForm
>
</
Grid
>
</
UserControl
>
When I add the readonlytemplate , it crashes. I can't find any error in the script.
I get the following error in the design view:
System.ArgumentException
Value does not fall within the expected range.
at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
at MS.Internal.XcpImports.MethodEx(DependencyObject obj, String name)
at MS.Internal.XcpImports.UIElement_UpdateLayout(UIElement element)
at Microsoft.Windows.Design.Platform.SilverlightViewProducer.OnViewUpdated()
Microsoft.Windows.Design.Platform.InvalidDesignerUpdateException
An unhandled exception was encountered while trying to render the current silverlight project on the design surface. To diagnose this failure, please try to run the project in a regular browser using the silverlight developer runtime.
Thank you in advance for your help.
Kam