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

Creating dynamic radpane

1 Answer 240 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Julio Andres
Top achievements
Rank 1
Julio Andres asked on 24 Feb 2016, 02:32 PM

I need to create radpane dynamically control this code except me and what I read does not support ItemSource property. As I can implemetar this solution using dynamic loaded radpane a collection of data.

<code>

 

<StackPanel Grid.Row="3" Grid.ColumnSpan="2" HorizontalAlignment="Center" Orientation="Horizontal">

            <Grid ScrollViewer.VerticalScrollBarVisibility="Auto">
                <StackPanel>
                    <Grid Name="gridMenu">
                        <Border Name="bordeMenu" />
                            <telerik:RadDocking x:Name="radDocking" ItemsSource="{Binding ElementoInvasivosVigentes}"  Width="355" Height="250" BorderBrush="White" BorderThickness="3" HorizontalAlignment="Left">
                                <telerik:RadSplitContainer  Orientation="Horizontal" InitialPosition="DockedLeft" Width="350" BorderBrush="Black" BorderThickness="2">
                                    <telerik:RadPaneGroup TabStripPlacement="Left" TabOrientation="Horizontal">
                                        <ItemsControl ItemsSource="{Binding ElementoInvasivosVigentes}" BorderBrush="LightGray" BorderThickness="2" Margin="5" Width="1180" Height="500">
                                            <ItemsControl.ItemTemplate>
                                                <DataTemplate>
                                                    <telerik:RadPane Header="EI" PaneHeaderVisibility="Collapsed">
                                                        <Grid>
                                                            <Grid.RowDefinitions>
                                                                <RowDefinition Height="50"/>
                                                                <RowDefinition Height="Auto" MinHeight="25"/>
                                                            </Grid.RowDefinitions>
                                                            <StackPanel Grid.Row="0" Orientation="Horizontal" VerticalAlignment="Center" Margin="0 0 0 0" Height="50">
                                                                <CheckBox
                                                               Content="{Binding NombreInvasivo}"
                                                               HorizontalAlignment="Left"
                                                                    Width="300"
                                                               Margin="10,0,0,0"                                     
                                                               VerticalAlignment="Center"/>

                                                                <telerik:RadButton x:Name="PART_show_menu" Grid.Column="1" Click="showMenuFlotante_Click"  Margin="0 0 0 0" HorizontalAlignment="Right" Height="22"
           Tag="{Binding}">
                                                                    <telerik:RadButton.Style>
                                                                        <Style TargetType="telerik:RadButton">
                                                                            <Setter Property="ContentTemplate">
                                                                                <Setter.Value>
                                                                                    <DataTemplate>
                                                                                        <Path Margin="2,0" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M0,0L5,0 5,1 4,1 4,2 3,2 3,3 2,3 2,2 1,2 1,1 0,1 0,0z"
                                                                                                    Fill="#FF282828" IsHitTestVisible="False" RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="True" />
                                                                                    </DataTemplate>
                                                                                </Setter.Value>
                                                                            </Setter>
                                                                        </Style>
                                                                    </telerik:RadButton.Style>
                                                                    <telerik:RadContextMenu.ContextMenu>
                                                                        <telerik:RadContextMenu>
                                                                            <telerik:RadMenuItem CommandParameter="{Binding}" Header="Retirar Elemento Invasivo" />
                                                                            <telerik:RadMenuItem CommandParameter="{Binding}" Header="Editar Elemento Invasivo" />
                                                                            <telerik:RadMenuItem  CommandParameter="{Binding}" Header="Pasar a Error de registro" />
                                                                            <telerik:RadMenuItem  CommandParameter="{Binding}" Header="Trasladar con Elemento Invasivo" />
                                                                            <telerik:RadMenuItem  CommandParameter="{Binding}" Header="Imprimir etiqueta" />
                                                                            <!--<telerik:RadMenuItem Command="{Binding Data.PlantillasCommand, Source={StaticResource proxy}}" CommandParameter="{Binding}" Header="Plantillas" />-->
                                                                        </telerik:RadContextMenu>
                                                                    </telerik:RadContextMenu.ContextMenu>
                                                                </telerik:RadButton>
                                                            </StackPanel >
                                                            <Border Grid.Row="1" BorderBrush="Black" BorderThickness="2" Margin="10" >
                                                                <Grid>
                                                                    <Grid.RowDefinitions>
                                                                        <RowDefinition Height="Auto" MinHeight="25"/>
                                                                        <RowDefinition Height="Auto" MinHeight="25"/>
                                                                        <RowDefinition Height="Auto" MinHeight="25"/>
                                                                        <RowDefinition Height="Auto" MinHeight="25"/>
                                                                        <RowDefinition Height="Auto" MinHeight="25"/>
                                                                        <RowDefinition Height="Auto" MinHeight="25"/>
                                                                    </Grid.RowDefinitions>
                                                                    <StackPanel Grid.Row="0" Orientation="Horizontal" Background="Gray">
                                                                        <TextBlock Text="Fecha Instalación:" VerticalAlignment="Center" Margin="5 0 0 0" />
                                                                        <TextBlock Text="{Binding FechaInstalacion}" VerticalAlignment="Center" Margin="25 0 0 0" />
                                                                    </StackPanel>

                                                                    <StackPanel Grid.Row="1" Orientation="Horizontal" Background="LightGray">
                                                                        <TextBlock Text="Sitio de Acceso:" VerticalAlignment="Center" Margin="5 0 0 0" />
                                                                        <TextBlock Text="{Binding SitioDeAcceso}" VerticalAlignment="Center" Margin="25 0 0 0" />
                                                                    </StackPanel>

                                                                    <StackPanel Grid.Row="2" Orientation="Horizontal" >
                                                                        <TextBlock Text="Unidad de Instalación:" VerticalAlignment="Center" Margin="5 0 0 0" />
                                                                        <TextBlock Text="{Binding UnidadDeInstalacion}" VerticalAlignment="Center" Margin="25 0 0 0" />
                                                                    </StackPanel>

                                                                    <StackPanel Grid.Row="3" Orientation="Horizontal" Background="LightGray" >
                                                                        <TextBlock Text="Nro días:" VerticalAlignment="Center" Margin="5 0 0 0" />
                                                                        <TextBlock Text="{Binding NroDias}" VerticalAlignment="Center" Margin="25 0 0 0" />
                                                                    </StackPanel>

                                                                    <StackPanel Grid.Row="4" Orientation="Horizontal">
                                                                        <TextBlock Text="Vinculación con I. Médica" VerticalAlignment="Center" Margin="5 0 0 0" />
                                                                        <TextBlock Text="{Binding VinculacionMedica}" VerticalAlignment="Center" Margin="25 0 0 0" />
                                                                    </StackPanel>

                                                                    <StackPanel Grid.Row="5" Orientation="Horizontal" Background="LightGray">
                                                                        <TextBlock Text="Notas" VerticalAlignment="Center" Margin="5 0 0 0" />
                                                                        <TextBlock Text="{Binding Nota}" VerticalAlignment="Center" Margin="25 0 0 0" />
                                                                    </StackPanel>
                                                                </Grid>
                                                            </Border>
                                                        </Grid>
                                                    </telerik:RadPane>
                                                </DataTemplate>
                                            </ItemsControl.ItemTemplate>
                                        </ItemsControl>
                                    </telerik:RadPaneGroup>
                                </telerik:RadSplitContainer>
                            </telerik:RadDocking>
                    </Grid>
                </StackPanel>
            </Grid>
        </StackPanel>

 

</code>

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 26 Feb 2016, 09:09 AM
Hi Julio,

RadDocking provides a way to create dynamic RadPanes through its PanesSource property, please check the PanesSource - MVVM Support topic in our documentation for detailed information on how it could be used.

Hope this would be helpful.

Regards,
Yana
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
Docking
Asked by
Julio Andres
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or