This question is locked. New answers and comments are not allowed.
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.
In the code behind a loop adds columns using the following piece of code:
What am I missing here?
Best regards
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
>
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