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

Display RadGridView as Stacked Grid

2 Answers 202 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Radhakrishnan
Top achievements
Rank 1
Radhakrishnan asked on 10 Oct 2008, 04:05 PM
I would like to display the columns of a DataRow in more than one row of the GridView.

Something like

HeaderRow            Last Name        First Name
                                Phone                Email

Row 1                    Bill                    Smith
                                719-999-9999 Bill@jk.com

Row 2                    Joe                    Brown
                                203-000-0000 Joe@br.com

Thanks
Radha

2 Answers, 1 is accepted

Sort by
0
Jimmy
Telerik team
answered on 13 Oct 2008, 01:18 PM
Hello Radhakrishnan,

Unfortunately RadGridView does not support such customization yet. A possible workaround could be to customize the row in a grid where two by two RowCells are on top of each other and will imitate the row layout that you want. Below is an example of how this could be done.

<ControlTemplate x:Key="MyCustomRowTemplate" TargetType="{x:Type telerik:GridViewRow}"
                <Grid  Height="100" Background="Red" Width=600
                    <Grid.RowDefinitions> 
                        <RowDefinition/> 
                        <RowDefinition/> 
                        <RowDefinition/> 
                        <RowDefinition/> 
                    </Grid.RowDefinitions> 
                    <Grid.ColumnDefinitions> 
                        <ColumnDefinition /> 
                        <ColumnDefinition /> 
                        <ColumnDefinition /> 
                        <ColumnDefinition /> 
                    </Grid.ColumnDefinitions> 
                    
                    <telerik:GridViewCell   Grid.Row="0" Grid.Column="0"  HorizontalAlignment="Center" ColumnName="FirstName"   VerticalAlignment="Center"/> 
                    <telerik:GridViewCell  Grid.Column="1" Grid.Row="0" ColumnName="LastName" HorizontalAlignment="Center" VerticalAlignment="Center" /> 
                    <telerik:GridViewCell   Grid.Row="1" Grid.Column="0"  HorizontalAlignment="Center" ColumnName="Phone"   VerticalAlignment="Center"/> 
                    <telerik:GridViewCell  Grid.Column="1" Grid.Row="1" ColumnName="Email" HorizontalAlignment="Center" VerticalAlignment="Center" /> 
            </Grid> 
        </ControlTemplate> 

However this techneque requires fixed Width as there is no property yet that you could bind to.

Custom header is another feature that is not yet supported in our GridView. However you can hide our default header row and implement your own custom UI header row that could be put inplace of the default one. That way you might be able to overcome the fized-size GridViewCell problem by implementing your own binding logic.




Regards,
Jimmy
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
James
Top achievements
Rank 1
answered on 18 Mar 2011, 03:05 AM
Is this still the case, or can we now have grids with stacked headers?
Tags
GridView
Asked by
Radhakrishnan
Top achievements
Rank 1
Answers by
Jimmy
Telerik team
James
Top achievements
Rank 1
Share this question
or