This is a migrated thread and some comments may be shown as answers.

AutoGenerateColumns Ignored under certain conditions

1 Answer 82 Views
GridView
This is a migrated thread and some comments may be shown as answers.
StevenDale
Top achievements
Rank 2
StevenDale asked on 14 Oct 2009, 06:22 PM

I have the latest build of WPF Q2 SP1 and I am getting the following error:
A TwoWay or OneWayToSource binding cannot work on the read-only property 'xxx' of type 'TelerikTestProject.TestClass'. This error happens whenever I place the GridView inside of a Actipro PopupButton and then inside of a Actipro ResizableContentControl. If I take the RadGrid out of the control I don't get the error. I have a sample project I can send you to reproduce the error.

<Window x:Class="TelerikTestProject.Window1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Title="Window1" Height="300" Width="300"   
    xmlns:shared="http://schemas.actiprosoftware.com/winfx/xaml/shared" 
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
        > 
    <Grid> 
        <shared:PopupButton Grid.Column="1" HorizontalContentAlignment="Left" BorderThickness="0" BorderBrush="Transparent" PopupContent="{Binding}" VerticalContentAlignment="Center" Margin="0" Background="Transparent" IsRounded="True" DisplayMode="Merged">  
            <shared:PopupButton.PopupContentTemplate> 
                <DataTemplate> 
                    <shared:ResizableContentControl MinHeight="50" MinWidth="300" Padding="1" > 
                        <telerik:RadGridView ItemsSource="{Binding Items}" AutoGenerateColumns="False" ShowGroupPanel="False">  
                            <telerik:RadGridView.Columns> 
                                <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Path=Comments}" UniqueName="{x:Null}"/>                                  
                            </telerik:RadGridView.Columns> 
                        </telerik:RadGridView> 
 
                    </shared:ResizableContentControl> 
                </DataTemplate> 
            </shared:PopupButton.PopupContentTemplate> 
        </shared:PopupButton> 
 
    </Grid> 
</Window> 
 

Thanks,

Billy Jacobs

1 Answer, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 15 Oct 2009, 02:55 PM
Hi Billy Jacobs,

Under some conditions AutoGenerateColumns does get ignored but luckily we have fixed this problem for our Q3 release. For the time being you could try to place the AutoGenerateColumns attribute on first place (before the ItemsSource property) and you should get consistent behavior.

Best wishes,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
StevenDale
Top achievements
Rank 2
Answers by
Milan
Telerik team
Share this question
or