This question is locked. New answers and comments are not allowed.
Hello all. I'm fairly new to Silverlight and the Telerik controls ... so I apologize if my question isn't precise enough. I'm working on an application with a particular design in mind for a RadGridView. The existing Telerik control seems to support virtually everything we need to implement the design (in Silverlight). One critical feature seems to only exist within the WinForms grid view control, HtmlViewDefinition.
The requirement was believed to be fairly straight forward. Much as with the standard demo here, we wanted to display several pieces of data stacked vertically within a single cell of the grid. However, unlike the demo which uses a custom row layout, we want our columns to remain connected to our row layout. In other words, in that demo, imagine that the image appears aligned beneath a column header labeled Thumbnail. Then, imagine that the next three columns (the ones actually seen in the demo ... First Name, Last Name, and City ... all appeared under a group header named "Basic Details". The data which displays the first name, last name, title, and city would be aligned in a "merged" column beneath the group header of "Basic Details". So the header labels for First Name, Last Name, and City would all appear across the space allocated to the group header ... and the data contents of each row's cell would essentially be column spanned across those three actual headers. It would have an appearance similar to this example of HtmlViewDefinition here.
For completeness, the final stack of content might appear under a single header column of "Additional Details" ... or it might have 2 or more detail columns like Hire Date and Phone which were then under a group header functioning like the previous merged content described above.
I believe that I could accomplish this with the HtmlViewDefinition functionality ... if it were available in the Silverlight control. As one possible alternative, I'm trying to create a custom row template which simply mirrors the layout of the column headers. This requires me to disable user resizing of the columns which is unfortunate but definitely NOT a deal breaker. In my case, I have a slightly more complicated layout, but the crux of it is that I have 4 groups of column headers with 3 or 4 individual columns under each group name. I then setup the final column in each group to expand it's width to "1*". This allows each group to have a pre-defined minimum width while growing evenly as the window is resized. What I have been unable to accomplish is a custom row layout which achieves the same scaling as the window is resized ... and I can't figure out where I've gone wrong.
I would love to have a cleaner solution, as the HtmlViewDefinition feels like it would have provided. That would allow me to have real columns (allowing features like sorting, filtering, and grouping to be made available for the data within the vertical stack of details) for each key piece of data without requiring each piece of data be listed in a distinct horizontal column (and taking up much more space) and also provide the layout and constraints of the columns visually without requiring me to lay them out manually within the custom row layout.
Any thoughts to help out? I can provide screen shots of what I wind up with if that's useful.
Here is a rough sample of the code I'm using to layout the custom row template (just placeholder stuff) and the column configuration:
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition MinWidth="267" Width="267*" />
<ColumnDefinition MinWidth="200" Width="200*" />
<ColumnDefinition MinWidth="200" Width="200*" />
<ColumnDefinition MinWidth="150" Width="150*" />
</Grid.ColumnDefinitions>
<TextBlock Text="Group A: " Grid.Column="0" Padding="5,0,0,0" FontWeight="Bold" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
<Border Width="1" Grid.Column="1" Padding="0,10" Background="{StaticResource BasicBrush}" HorizontalAlignment="Left" VerticalAlignment="Stretch" />
<TextBlock Text="Group B: " Grid.Column="1" Padding="6,0,0,0" FontWeight="Bold" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
<Border Width="1" Grid.Column="2" Padding="0,10" Background="{StaticResource BasicBrush}" HorizontalAlignment="Left" VerticalAlignment="Stretch" />
<TextBlock Text="Group C: " Grid.Column="2" Padding="6,0,0,0" FontWeight="Bold" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
<Border Width="1" Grid.Column="3" Padding="0,10" Background="{StaticResource BasicBrush}" HorizontalAlignment="Left" VerticalAlignment="Stretch" />
<TextBlock Text="Group D: " Grid.Column="3" Padding="6,0,0,0" FontWeight="Bold" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
</Grid>
<telerik:RadGridView.ColumnGroups>
<telerik:GridViewColumnGroup Name="GroupA" Header="Group A" />
<telerik:GridViewColumnGroup Name="GroupB" Header="Group B" />
<telerik:GridViewColumnGroup Name="GroupC" Header="Group C" />
<telerik:GridViewColumnGroup Name="GroupD" Header="Group D" />
</telerik:RadGridView.ColumnGroups>
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn MinWidth="76" MaxWidth="76" ColumnGroupName="GroupA"><telerik:GridViewDataColumn.Header><TextBlock TextWrapping="Wrap">Field A 1</TextBlock></telerik:GridViewDataColumn.Header></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn MinWidth="56" MaxWidth="56" ColumnGroupName="GroupA"><telerik:GridViewDataColumn.Header><TextBlock TextWrapping="Wrap">Field A 2</TextBlock></telerik:GridViewDataColumn.Header></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn MinWidth="65" MaxWidth="65" ColumnGroupName="GroupA"><telerik:GridViewDataColumn.Header><TextBlock TextWrapping="Wrap">Field A 3</TextBlock></telerik:GridViewDataColumn.Header></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn MinWidth="70" Width="1*" ColumnGroupName="GroupA"><telerik:GridViewDataColumn.Header><TextBlock TextWrapping="Wrap">Field A 4</TextBlock></telerik:GridViewDataColumn.Header></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn MinWidth="50" MaxWidth="50" ColumnGroupName="GroupB"><telerik:GridViewDataColumn.Header><TextBlock TextWrapping="Wrap">Field B 1</TextBlock></telerik:GridViewDataColumn.Header></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn MinWidth="70" MaxWidth="70" ColumnGroupName="GroupB"><telerik:GridViewDataColumn.Header><TextBlock TextWrapping="Wrap">Field B 2</TextBlock></telerik:GridViewDataColumn.Header></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn MinWidth="80" Width="1*" ColumnGroupName="GroupB"><telerik:GridViewDataColumn.Header><TextBlock TextWrapping="Wrap">Field B 3</TextBlock></telerik:GridViewDataColumn.Header></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn MinWidth="50" MaxWidth="50" ColumnGroupName="GroupC"><telerik:GridViewDataColumn.Header><TextBlock TextWrapping="Wrap">Field C 1</TextBlock></telerik:GridViewDataColumn.Header></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn MinWidth="70" MaxWidth="70" ColumnGroupName="GroupC"><telerik:GridViewDataColumn.Header><TextBlock TextWrapping="Wrap">Field C 2</TextBlock></telerik:GridViewDataColumn.Header></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn MinWidth="80" Width="1*" ColumnGroupName="GroupC"><telerik:GridViewDataColumn.Header><TextBlock TextWrapping="Wrap">Field C 3</TextBlock></telerik:GridViewDataColumn.Header></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn MinWidth="50" MaxWidth="50" ColumnGroupName="GroupD"><telerik:GridViewDataColumn.Header><TextBlock TextWrapping="Wrap">Field D 1</TextBlock></telerik:GridViewDataColumn.Header></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn MinWidth="50" MaxWidth="50" ColumnGroupName="GroupD"><telerik:GridViewDataColumn.Header><TextBlock TextWrapping="Wrap">Field D 2</TextBlock></telerik:GridViewDataColumn.Header></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn MinWidth="50" Width="1*" ColumnGroupName="GroupD"><telerik:GridViewDataColumn.Header><TextBlock TextWrapping="Wrap">Field D 3</TextBlock></telerik:GridViewDataColumn.Header></telerik:GridViewDataColumn>
</telerik:RadGridView.Columns>
The requirement was believed to be fairly straight forward. Much as with the standard demo here, we wanted to display several pieces of data stacked vertically within a single cell of the grid. However, unlike the demo which uses a custom row layout, we want our columns to remain connected to our row layout. In other words, in that demo, imagine that the image appears aligned beneath a column header labeled Thumbnail. Then, imagine that the next three columns (the ones actually seen in the demo ... First Name, Last Name, and City ... all appeared under a group header named "Basic Details". The data which displays the first name, last name, title, and city would be aligned in a "merged" column beneath the group header of "Basic Details". So the header labels for First Name, Last Name, and City would all appear across the space allocated to the group header ... and the data contents of each row's cell would essentially be column spanned across those three actual headers. It would have an appearance similar to this example of HtmlViewDefinition here.
For completeness, the final stack of content might appear under a single header column of "Additional Details" ... or it might have 2 or more detail columns like Hire Date and Phone which were then under a group header functioning like the previous merged content described above.
I believe that I could accomplish this with the HtmlViewDefinition functionality ... if it were available in the Silverlight control. As one possible alternative, I'm trying to create a custom row template which simply mirrors the layout of the column headers. This requires me to disable user resizing of the columns which is unfortunate but definitely NOT a deal breaker. In my case, I have a slightly more complicated layout, but the crux of it is that I have 4 groups of column headers with 3 or 4 individual columns under each group name. I then setup the final column in each group to expand it's width to "1*". This allows each group to have a pre-defined minimum width while growing evenly as the window is resized. What I have been unable to accomplish is a custom row layout which achieves the same scaling as the window is resized ... and I can't figure out where I've gone wrong.
I would love to have a cleaner solution, as the HtmlViewDefinition feels like it would have provided. That would allow me to have real columns (allowing features like sorting, filtering, and grouping to be made available for the data within the vertical stack of details) for each key piece of data without requiring each piece of data be listed in a distinct horizontal column (and taking up much more space) and also provide the layout and constraints of the columns visually without requiring me to lay them out manually within the custom row layout.
Any thoughts to help out? I can provide screen shots of what I wind up with if that's useful.
Here is a rough sample of the code I'm using to layout the custom row template (just placeholder stuff) and the column configuration:
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition MinWidth="267" Width="267*" />
<ColumnDefinition MinWidth="200" Width="200*" />
<ColumnDefinition MinWidth="200" Width="200*" />
<ColumnDefinition MinWidth="150" Width="150*" />
</Grid.ColumnDefinitions>
<TextBlock Text="Group A: " Grid.Column="0" Padding="5,0,0,0" FontWeight="Bold" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
<Border Width="1" Grid.Column="1" Padding="0,10" Background="{StaticResource BasicBrush}" HorizontalAlignment="Left" VerticalAlignment="Stretch" />
<TextBlock Text="Group B: " Grid.Column="1" Padding="6,0,0,0" FontWeight="Bold" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
<Border Width="1" Grid.Column="2" Padding="0,10" Background="{StaticResource BasicBrush}" HorizontalAlignment="Left" VerticalAlignment="Stretch" />
<TextBlock Text="Group C: " Grid.Column="2" Padding="6,0,0,0" FontWeight="Bold" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
<Border Width="1" Grid.Column="3" Padding="0,10" Background="{StaticResource BasicBrush}" HorizontalAlignment="Left" VerticalAlignment="Stretch" />
<TextBlock Text="Group D: " Grid.Column="3" Padding="6,0,0,0" FontWeight="Bold" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
</Grid>
<telerik:RadGridView.ColumnGroups>
<telerik:GridViewColumnGroup Name="GroupA" Header="Group A" />
<telerik:GridViewColumnGroup Name="GroupB" Header="Group B" />
<telerik:GridViewColumnGroup Name="GroupC" Header="Group C" />
<telerik:GridViewColumnGroup Name="GroupD" Header="Group D" />
</telerik:RadGridView.ColumnGroups>
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn MinWidth="76" MaxWidth="76" ColumnGroupName="GroupA"><telerik:GridViewDataColumn.Header><TextBlock TextWrapping="Wrap">Field A 1</TextBlock></telerik:GridViewDataColumn.Header></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn MinWidth="56" MaxWidth="56" ColumnGroupName="GroupA"><telerik:GridViewDataColumn.Header><TextBlock TextWrapping="Wrap">Field A 2</TextBlock></telerik:GridViewDataColumn.Header></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn MinWidth="65" MaxWidth="65" ColumnGroupName="GroupA"><telerik:GridViewDataColumn.Header><TextBlock TextWrapping="Wrap">Field A 3</TextBlock></telerik:GridViewDataColumn.Header></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn MinWidth="70" Width="1*" ColumnGroupName="GroupA"><telerik:GridViewDataColumn.Header><TextBlock TextWrapping="Wrap">Field A 4</TextBlock></telerik:GridViewDataColumn.Header></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn MinWidth="50" MaxWidth="50" ColumnGroupName="GroupB"><telerik:GridViewDataColumn.Header><TextBlock TextWrapping="Wrap">Field B 1</TextBlock></telerik:GridViewDataColumn.Header></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn MinWidth="70" MaxWidth="70" ColumnGroupName="GroupB"><telerik:GridViewDataColumn.Header><TextBlock TextWrapping="Wrap">Field B 2</TextBlock></telerik:GridViewDataColumn.Header></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn MinWidth="80" Width="1*" ColumnGroupName="GroupB"><telerik:GridViewDataColumn.Header><TextBlock TextWrapping="Wrap">Field B 3</TextBlock></telerik:GridViewDataColumn.Header></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn MinWidth="50" MaxWidth="50" ColumnGroupName="GroupC"><telerik:GridViewDataColumn.Header><TextBlock TextWrapping="Wrap">Field C 1</TextBlock></telerik:GridViewDataColumn.Header></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn MinWidth="70" MaxWidth="70" ColumnGroupName="GroupC"><telerik:GridViewDataColumn.Header><TextBlock TextWrapping="Wrap">Field C 2</TextBlock></telerik:GridViewDataColumn.Header></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn MinWidth="80" Width="1*" ColumnGroupName="GroupC"><telerik:GridViewDataColumn.Header><TextBlock TextWrapping="Wrap">Field C 3</TextBlock></telerik:GridViewDataColumn.Header></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn MinWidth="50" MaxWidth="50" ColumnGroupName="GroupD"><telerik:GridViewDataColumn.Header><TextBlock TextWrapping="Wrap">Field D 1</TextBlock></telerik:GridViewDataColumn.Header></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn MinWidth="50" MaxWidth="50" ColumnGroupName="GroupD"><telerik:GridViewDataColumn.Header><TextBlock TextWrapping="Wrap">Field D 2</TextBlock></telerik:GridViewDataColumn.Header></telerik:GridViewDataColumn>
<telerik:GridViewDataColumn MinWidth="50" Width="1*" ColumnGroupName="GroupD"><telerik:GridViewDataColumn.Header><TextBlock TextWrapping="Wrap">Field D 3</TextBlock></telerik:GridViewDataColumn.Header></telerik:GridViewDataColumn>
</telerik:RadGridView.Columns>