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

Extra columns added extra partly overlap those defined in xaml

7 Answers 44 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Henri
Top achievements
Rank 1
Henri asked on 18 Apr 2011, 01:30 PM
Hello,

I'm using the 2011 Q1 version of the Silverlight controls. In XAML i defined a radgridview with 7 columns.
In the code behind I added some extra columns.
The problem is that these columns partly overlap the columns already defined in XAML.

                    <telerik:RadGridView x:Name="gridElHeader" telerik:StyleManager.Theme="Windows7" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden" FrozenColumnCount="7" HeaderRowStyle="{StaticResource GridHeaderRowStyle}" CanUserDeleteRows="False" CanUserFreezeColumns="False" CanUserInsertRows="False" CanUserReorderColumns="False" AutoGenerateColumns="False" ShowGroupPanel="False" RowIndicatorVisibility="Collapsed" ShowColumnFooters="False" ShowGroupFooters="False" ScrollMode="Deferred" ><br>
                        <telerik:RadGridView.Columns><br>
                            <telerik:GridViewColumn HeaderCellStyle="{StaticResource GreenHeaderStyle}" Width="90"><br>
                                <telerik:GridViewColumn.Header><br>
                                    <TextBlock Text="Ressource Kostenstelle" TextWrapping="Wrap" TextAlignment="Center" Foreground="Black" FontWeight="Bold"/><br>
                                </telerik:GridViewColumn.Header><br>
                            </telerik:GridViewColumn><br>
                            <telerik:GridViewColumn HeaderCellStyle="{StaticResource GreenHeaderStyle}" Width="50"><br>
                                <telerik:GridViewColumn.Header><br>
                                    <TextBlock Text="Pers KG" TextWrapping="Wrap" TextAlignment="Center" Foreground="Black" FontWeight="Bold"/><br>
                                </telerik:GridViewColumn.Header><br>
                            </telerik:GridViewColumn><br>
                            <telerik:GridViewColumn HeaderCellStyle="{StaticResource GreenHeaderStyle}" Width="50" ><br>
                                <telerik:GridViewColumn.Header><br>
                                    <TextBlock Text="Ge-werk" TextWrapping="Wrap" TextAlignment="Center" Foreground="Black" FontWeight="Bold"/><br>
                                </telerik:GridViewColumn.Header><br>
                            </telerik:GridViewColumn><br>
                            <telerik:GridViewColumn HeaderCellStyle="{StaticResource GreenHeaderStyle}" Width="120" ><br>
                                <telerik:GridViewColumn.Header><br>
                                    <TextBlock Text="Name" TextWrapping="Wrap" TextAlignment="Center" Foreground="Black" FontWeight="Bold"/><br>
                                </telerik:GridViewColumn.Header><br>
                            </telerik:GridViewColumn><br>
                            <telerik:GridViewColumn HeaderCellStyle="{StaticResource GreenHeaderStyle}" Width="40" ><br>
                                <telerik:GridViewColumn.Header><br>
                                    <TextBlock Text="Pers Nr" TextWrapping="Wrap" TextAlignment="Center" Foreground="Black" FontWeight="Bold"/><br>
                                </telerik:GridViewColumn.Header><br>
                            </telerik:GridViewColumn><br>
                            <telerik:GridViewColumn HeaderCellStyle="{StaticResource GreenHeaderStyle}"><br>
                                <telerik:GridViewColumn.CellTemplate><br>
                                    <DataTemplate><br>
                                        <TextBlock Text="€"/><br>
                                    </DataTemplate><br>
                                </telerik:GridViewColumn.CellTemplate><br>
                            </telerik:GridViewColumn><br>
                            <telerik:GridViewColumn HeaderCellStyle="{StaticResource GreenHeaderStyle}" IsVisible="False"><br>
                                <telerik:GridViewColumn.CellTemplate><br>
                                    <DataTemplate><br>
                                        <TextBlock Text="St"/><br>
                                    </DataTemplate><br>
                                </telerik:GridViewColumn.CellTemplate><br>
                            </telerik:GridViewColumn><br>
                        </telerik:RadGridView.Columns><br>
                    </telerik:RadGridView><br>
<br>
In the code behind a loop adds columns using the following piece of code:

                    Grid g = new Grid();<br>
                    g.RowDefinitions.Add(new RowDefinition());<br>
                    g.RowDefinitions.Add(new RowDefinition());<br>
                    g.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(60) });<br>
                    g.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(60) });<br>
                    TextBlock tb = new TextBlock<br>
                                       {<br>
                                           TextAlignment = TextAlignment.Center,<br>
                                           FontWeight = FontWeights.Bold,<br>
                                           Text = dt.ToString("MMMM yyyy",_german)<br>
                                       };<br>
                    Border b = new Border<br>
                                   {<br>
                                       BorderBrush = new SolidColorBrush(Colors.Gray),<br>
                                       BorderThickness = new Thickness(0, 0, 0, 1),<br>
                                       Child = tb<br>
                                   };<br>
                    Grid.SetRow(b, 0);<br>
                    Grid.SetColumnSpan(b, 2);<br>
                    g.Children.Add(b);<br>
                    tb = new TextBlock<br>
                    {<br>
                        TextAlignment = TextAlignment.Center,<br>
                        FontWeight = FontWeights.Bold,<br>
                        Text = dt.ToString("Plan")<br>
                    };<br>
                    b = new Border<br>
                    {<br>
                        BorderBrush = new SolidColorBrush(Colors.Gray),<br>
                        BorderThickness = new Thickness(0, 0, 1, 0),<br>
                        Child = tb<br>
                    };<br>
                    Grid.SetRow(b, 1);<br>
                    Grid.SetColumn(b, 0);<br>
                    g.Children.Add(b);<br>
                    tb = new TextBlock<br>
                    {<br>
                        TextAlignment = TextAlignment.Center,<br>
                        FontWeight = FontWeights.Bold,<br>
                        Text = dt.ToString("IST")<br>
                    };<br>
                    b = new Border<br>
                    {<br>
                        BorderBrush = new SolidColorBrush(Colors.Gray),<br>
                        BorderThickness = new Thickness(0, 0, 0, 0),<br>
                        Child = tb<br>
                    };<br>
                    Grid.SetRow(b, 1);<br>
                    Grid.SetColumn(b, 1);<br>
                    g.Children.Add(b);<br>
<br>
                    gvc = new GridViewColumn<br>
                              {<br>
                                  Width = 120,<br>
                                  Header = g,<br>
                                  HeaderCellStyle = (Style)Application.Current.Resources["YellowHeaderStyle"]<br>
                              };<br>
<br>
                    gridElHeader.Columns.Add(gvc);<br>

What am I missing here?

Best regards

7 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 18 Apr 2011, 02:14 PM
Hi Henri,

 

Thank you for reporting this issue!
We were able to reproduce it by our side and it is related to the IsVisible property of last your column defined in xaml. Furthermore it has been already resolved and you may try our latest internal build, where such a behavior cannot be observed. 

  
Please excuse us for any inconvenience caused.

Regards,
Vanya Pavlova
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
0
Henri
Top achievements
Rank 1
answered on 18 Apr 2011, 03:52 PM
Hi,

I'm having trouble using the latest internal build.
I copied the binaries to the telerik install dir, overwriting the previous versions.
I updated my project references, but now I always get following error at compile time:

System.IO.FileLoadException
Could not load file or assembly 'Telerik.Windows.Controls.Docking, Version=2011.1.411.1040, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
 
0
Vanya Pavlova
Telerik team
answered on 18 Apr 2011, 04:01 PM
Hello Henri,



You may try to delete the Bin/Obj folders too. Then try to rebuild the application and let us know if the problem still exists. If so please send you a runnable application in a new support ticket which we can use for local testing.



Kind regards,
Vanya Pavlova
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
0
Henri
Top achievements
Rank 1
answered on 19 Apr 2011, 08:13 AM
Hello again,

I tried deleting the Bin and Obj folders, but that didn't help.
I cannot make a runnable program because even in the designer, the Telerik binaries fail to load.
I can reference them in my project, but I cannot drag them from the toolbox to the designer.

Could not load file or assembly 'Telerik.Windows.Themes.Windows7, Version=2011.1.411.1040, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)   

Could not load file or assembly 'Telerik.Windows.Controls.Navigation, Version=2011.1.411.1040, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)  

Could not load file or assembly 'Telerik.Windows.Controls.GridView, Version=2011.1.411.1040, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

System.NotSupportedException
An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.

In the project references I can see that the correct version of the binaries is referenced.

Best regards...
0
Vlad
Telerik team
answered on 19 Apr 2011, 08:22 AM
Hello,

 Please send us your project via support ticket. We will fix your references.

Kind regards,
Vlad
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
0
Henri
Top achievements
Rank 1
answered on 19 Apr 2011, 08:29 AM
Hello,

Thank you for the quick reply :)

I don't think that the problem lies with the references.
Even when I start a brand new project, I get the same errors.

Henri.

0
Henri
Top achievements
Rank 1
answered on 19 Apr 2011, 08:52 AM
Hello Vlad,

My bad :)
I had to Unblock the Zip file before using it.
Now everything works again and my original overlapping problem is fixed.

Thank you.
Tags
GridView
Asked by
Henri
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Henri
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or