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

Place two GridViews

2 Answers 38 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Orit
Top achievements
Rank 1
Orit asked on 12 Oct 2009, 12:45 PM
I have to place two GridViews
in the same place
one is visible and the other id hidden
I can change the visibilty of each one
but only one can be visible

I tried to use DockPanel
but they are placed one beside the other
and not one "over" the other

this is my code
<DockPanel> 
                    <StackPanel DockPanel.Dock="Top" Background="CornflowerBlue" Orientation="Horizontal">  
                        <Button Margin="2,1,2,1">הפק דוח</Button> 
                        <Button Name="btnCancelSystemTables" Margin="2,1,2,1" Click="btnCancelSystemTables_Click">בטל</Button> 
                        <Button Name="btnNewSystemTables" Margin="2,1,2,1" Click="btnNewSystemTables_Click">חדש</Button> 
                        <Button Name="btnDeleteSystemTables" Margin="2,1,2,1" Click="btnDeleteSystemTables_Click">מחק</Button> 
                        <Button Name="btnSaveSystemTables" Margin="2,1,2,1" Click="btnSaveSystemTables_Click">שמור</Button> 
                    </StackPanel> 
                    <StackPanel DockPanel.Dock="Top" Margin="10,10,10,10" Orientation="Horizontal">  
                        <TextBlock Margin="5,5,5,5">שם טבלה</TextBlock> 
                        <ComboBox Name="cmbTableName" DisplayMemberPath="Name" Margin="5,5,5,5" Width="120" SelectionChanged="cmbTableName_SelectionChanged"></ComboBox> 
                        <Button Name="btnMoveUp" Click="btnMoveUp_Click">+</Button> 
                        <Button Name="btnMoveDown" Click="btnMoveDown_Click">-</Button> 
                    </StackPanel> 
                    <telerik:RadGridView DockPanel.Dock="Left" Visibility="Hidden"  Name="gvSystemTables" Margin="5,5,5,5" Height="520" Width="350" AutoGenerateColumns="False" 
                                 IsFilteringAllowed="False" FlowDirection="RightToLeft" ShowGroupPanel="False" CellEditEnded="gvSystemTables_CellEditEnded">  
                           <telerik:RadGridView.Columns> 
                                <telerik:GridViewDataColumn IsReadOnly="True" UniqueName="ID" Header="קוד" Width="50"/>  
                                <telerik:GridViewDataColumn IsReadOnly="False" UniqueName="Name" Header="ערך" Width="250"/>                                 
                            </telerik:RadGridView.Columns> 
                        </telerik:RadGridView> 
                    <telerik:RadGridView DockPanel.Dock="Left" Visibility="Hidden"  Name="gvLoadingUnitFrame" Margin="5,5,5,5" Height="520" Width="350" AutoGenerateColumns="False" 
                                 IsFilteringAllowed="False" FlowDirection="RightToLeft" ShowGroupPanel="False" CellEditEnded="gvLoadingUnitFrame_CellEditEnded">  
                       <telerik:RadGridView.Columns> 
                            <telerik:GridViewComboBoxColumn UniqueName="LoadingUnit" DataMemberBinding="{Binding LoadingUnit}" DisplayMemberPath="Name" SelectedValueMemberPath="Id" Header="לקוח להעמסה" Width="110"  /> 
                            <telerik:GridViewDataColumn IsReadOnly="False" UniqueName="LoadingFrame" Header="מסגרת" Width="110"/>  
                           <telerik:GridViewComboBoxColumn UniqueName="OBSID" DataMemberBinding="{Binding OBSID}" DisplayMemberPath="Name" SelectedValueMemberPath="Id" Header="ענף" Width="110"  /> 
                       </telerik:RadGridView.Columns> 
                    </telerik:RadGridView> 
                    <TreeView DockPanel.Dock="Left" Visibility="Hidden" Margin="10,10,0,13" Name="tvOBS" HorizontalAlignment="Left" VerticalAlignment="Top" Width="350" Height="520" KeyDown="tvOBS_KeyDown"></TreeView> 
                    <StackPanel DockPanel.Dock="Top">  
                        <Popup x:Name="PopupEditTv" AllowsTransparency="True" Width="250" Height="150">  
                            <Border Background="White" BorderBrush="Gray" BorderThickness="2">  
                                <StackPanel Margin="10,10,10,10">  
                                    <TextBlock Margin="5,5,5,5">הכנס שם יחידה</TextBlock> 
                                    <TextBox DockPanel.Dock="Top" Name="txtbEditTv" Width="80" Height="20"></TextBox> 
                                    <StackPanel Orientation="Horizontal">  
                                        <Button Margin="5,5,5,5" Name="btnSaveTvText" Width="auto" Click="btnSaveTvText_Click">שמור</Button> 
                                        <Button Margin="5,5,5,5" Name="btnCancelTvText" Width="auto" Click="btnCancelTvText_Click">בטל</Button> 
                                    </StackPanel> 
                                </StackPanel> 
                            </Border> 
                        </Popup> 
                    </StackPanel> 
                    <StackPanel DockPanel.Dock="Top">  
                        <Popup x:Name="PopupTest" AllowsTransparency="True" Width="250" Height="150">  
                            <Border Background="White" BorderBrush="Gray" BorderThickness="2">  
                            <StackPanel Margin="10,10,10,10">  
                                <TextBlock Margin="5,5,5,5">בחר סוג פעילות להוספה</TextBlock> 
                                <RadioButton Margin="5,5,5,5" Name="rbInv" IsChecked="True" GroupName="rbActType">השקעות</RadioButton> 
                                <RadioButton Margin="5,5,5,5" Name="rbCon" GroupName="rbActType">שוטף</RadioButton> 
                                <StackPanel Orientation="Horizontal">  
                                    <Button Margin="5,5,5,5" Name="btnAddActType" Click="btnAddActType_Click" Width="auto">בחר</Button> 
                                    <Button Margin="5,5,5,5" Name="btnCancelActType" Width="auto" Click="btnCancelActType_Click">בטל</Button> 
                                </StackPanel>                                          
                            </StackPanel> 
                            </Border> 
                        </Popup> 
                    </StackPanel> 
                </DockPanel> 

Thanks!!

2 Answers, 1 is accepted

Sort by
0
Accepted
Milan
Telerik team
answered on 12 Oct 2009, 04:16 PM
Hello Orit,

You just need to place the two grids in the same Grid panel (only the two grids) and they will overlap.

Kind regards,
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.
0
Orit
Top achievements
Rank 1
answered on 13 Oct 2009, 05:32 AM
Thanks!
Tags
GridView
Asked by
Orit
Top achievements
Rank 1
Answers by
Milan
Telerik team
Orit
Top achievements
Rank 1
Share this question
or