Dataform does not working/rendered

6 posts, 0 answers
  1. Kamal Mostofi
    Kamal Mostofi avatar
    56 posts
    Member since:
    Jan 2010

    Posted 27 Mar 2011 Link to this post

    Hello everyone,

    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:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"  
                 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
  2. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 28 Mar 2011 Link to this post

    Hello Kamal Mostofi,

    Does the application only crash in design-time or it also crashes run-time?


    Best wishes,
    Milan
    the Telerik team
  3. DevCraft banner
  4. Kamal Mostofi
    Kamal Mostofi avatar
    56 posts
    Member since:
    Jan 2010

    Posted 28 Mar 2011 Link to this post

    Hello,

    It crashes at design time and when I run the application, everything seems fine but when I try to open the selected page to view the form, nothing happens.
    I revert it back to the normal Dataform and the application works perfectly but not with Telerik dataform :-(

    Regards,
    Kamal
  5. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 30 Mar 2011 Link to this post

    Hi Kamal Mostofi,

    I am trying to reproduve the problem here , but maybe I am missing something .

    Can you please send me your project  ( via support ticket ) . I will be glad to debug it for you and provide the fixes neccessary.

    Regards,
    Pavel Pavlov
    the Telerik team
  6. Kamal Mostofi
    Kamal Mostofi avatar
    56 posts
    Member since:
    Jan 2010

    Posted 31 Mar 2011 Link to this post

    Hello Milan,

    If I add ReadOnlyTemplate, it crashes at design time. And when I set the form to autogeneratefield to true and remove the templates, it crashes at runtime.
    However, I was able to add the data form to another page and it worked. Let me check my code tonight and let you know the status of my issue.

    Kind regards,
    Kam
  7. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 05 Apr 2011 Link to this post

    Hi Kamal ,
    I am curious to know what went wrong and I will ba glad if you share your findings.In case  I can be in further help , just let me know .

    Greetings,
    Pavel Pavlov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
DevCraft banner