Details and Grid views in the same RadTabItem

2 posts, 0 answers
  1. Frank
    Frank avatar
    4 posts
    Member since:
    Sep 2008

    Posted 11 Jul 2010 Link to this post

    Hello,

    I just downloaded the trial version of your SL4 Controls. Most of my friends are recommending Telerik and so far I am really amazed by them.

    After spending a lot of time reading this forum plus the RADTab documentation I still can't figure out how to incorporate the Details and Grid views of the same (Consultations for a Patient) inside one TAB Item.

    Can you help me



    The error (The property 'Content' is set more than once) occurs when I add the code inside
    <!--DETAILS GRID START-->

    ......
    XAML
    .....

    <!--DETAILS GRID END-->


    If I remove the XAML (inside the commented lines shown above) everything works fine

    <navigation:Page x:Class="MedLink.Views.Pages.Patient"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               mc:Ignorable="d"
               xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
               d:DesignWidth="800" d:DesignHeight="800"
               Title="Patient Page" xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices"
                     xmlns:my="clr-namespace:MedLink.Web.Models"
                     xmlns:my1="clr-namespace:MedLink.Web.Services"
                     xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
                     xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                     BorderThickness="1"
                     Background="#FFF5DF91"
                     ToolTipService.ToolTip="Paciente">
        <sdk:Page.Resources>
            <CollectionViewSource x:Key="med_Patientmed_ConsultationsViewSource" Source="{Binding Path=Data.med_Consultations, ElementName=med_PatientDomainDataSource}" />
        </sdk:Page.Resources>
        <Grid x:Name="LayoutRoot" Background="#FFFDE191" AllowDrop="False">
            <riaControls:DomainDataSource AutoLoad="True" d:DesignData="{d:DesignInstance my:med_Patient, CreateList=true}" Height="0" LoadedData="med_PatientDomainDataSource_LoadedData" Name="med_PatientDomainDataSource" QueryName="GetMed_PatientForDashBoardQuery" Width="0">
                <riaControls:DomainDataSource.DomainContext>
                    <my1:MedLinkDomainContext />
                </riaControls:DomainDataSource.DomainContext>
            </riaControls:DomainDataSource>
           <telerik:RadTabControl BackgroundVisibility="Collapsed"  x:Name="RadTabControl1" Background="Transparent" telerik:StyleManager.Theme="Office_Black">
                 
               <!--Tab Info Patient -->
                <telerik:RadTabItem Header="Patient" DataContext="{Binding ElementName=med_PatientDomainDataSource, Path=Data}" Height="24" Foreground="Black">
                      <Grid DataContext="{Binding ElementName=med_PatientDomainDataSource, Path=Data}" HorizontalAlignment="Left" Name="gridInfoPatient" VerticalAlignment="Top" >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="200" />
                            <ColumnDefinition Width="240" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                              <RowDefinition Height="39*" />
                        </Grid.RowDefinitions>
     
     
                        <sdk:Label Content="Patient Name:" Grid.Column="0" Grid.Row="1" HorizontalAlignment="Right" Margin="3" VerticalAlignment="Center" MaxWidth="200" MinWidth="200"  />
                        <sdk:Label Content="Patient Last:" Grid.Column="0" Grid.Row="2" HorizontalAlignment="Right" Margin="3" VerticalAlignment="Center" MaxWidth="200" MinWidth="200" />
     
                        <TextBox Grid.Column="1" Grid.Row="1" Height="23" HorizontalAlignment="Left" Margin="3" Name="Patient_NameTextBox" Text="{Binding Path=Patient_Name, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, TargetNullValue=''}" VerticalAlignment="Center" Width="230" HorizontalContentAlignment="Left" IsTabStop="True" MaxLength="50"/>
                        <TextBox Grid.Column="1" Grid.Row="2" Height="23" HorizontalAlignment="Left" Margin="3" Name="Patient_LastTextBox" Text="{Binding Path=Patient_Last, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, TargetNullValue=''}" VerticalAlignment="Center" Width="230" HorizontalContentAlignment="Left" IsTabStop="True" MaxLength="50"/>
     
     
                    </Grid>
                </telerik:RadTabItem>
                <!-- End Tab Info Patient -->
     
                <!-- RadTabItem Consultations -->
                <telerik:RadTabItem Header="Consultations" DataContext="{Binding}" Foreground="Black">
                    <!--DETAILS GRID START-->
                    <Grid DataContext="{Binding Source={StaticResource med_Patientmed_ConsultationsViewSource}, Path=CurrentItem}" HorizontalAlignment="Left" Margin="31,67,0,0" Name="grid1" VerticalAlignment="Top">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <sdk:Label Content="Consult Date:" Grid.Column="0" Grid.Row="3" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
                        <sdk:DatePicker Grid.Column="1" Grid.Row="3" Height="23" HorizontalAlignment="Left" Margin="3" Name="consult_DateDatePicker" SelectedDate="{Binding Path=Consult_Date, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, TargetNullValue=''}" VerticalAlignment="Center" Width="120" />
                        <sdk:Label Content="Consult Diagnosis:" Grid.Column="0" Grid.Row="4" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
                        <TextBox Grid.Column="1" Grid.Row="4" Height="23" HorizontalAlignment="Left" Margin="3" Name="consult_DiagnosisTextBox" Text="{Binding Path=Consult_Diagnosis, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, TargetNullValue=''}" VerticalAlignment="Center" Width="120" />
                        <sdk:Label Content="Medication Notes:" Grid.Column="0" Grid.Row="5" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
                        <TextBox Grid.Column="1" Grid.Row="5" Height="23" HorizontalAlignment="Left" Margin="3" Name="medication_NotesTextBox" Text="{Binding Path=Medication_Notes, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, TargetNullValue=''}" VerticalAlignment="Center" Width="120" />
                    </Grid>
                    <!--DETAILS GRID END-->
                    <telerik:RadGridView ItemsSource="{Binding Source={StaticResource med_Patientmed_ConsultationsViewSource}}" 
                                                     RowIndicatorVisibility="Collapsed"
                                                     AutoGenerateColumns="False"
                                                     CanUserFreezeColumns="False"
                                                     BorderThickness="0"
                                                     CanUserResizeColumns="False"
                                                    ShowGroupPanel="False" Height="191" VerticalAlignment="Bottom">
                        <telerik:RadGridView.RowDetailsTemplate>
                            <DataTemplate>
                                <telerik:RadGridView AutoGenerateColumns="False" IsFilteringAllowed="False"
                                                                              ItemsSource="{Binding Source={StaticResource med_Patientmed_ConsultationsViewSource}}"
                                                                 CanUserReorderColumns="False"
                                                                              CanUserFreezeColumns="False" CanUserResizeColumns="False"
                                                                              ShowGroupPanel="False"
                                                                              Margin="6">
                                    <telerik:RadGridView.Columns>
     
                                        <telerik:GridViewToggleRowDetailsColumn CellStyle="{StaticResource GridViewToggleButtonColumnStyle}" />
     
     
                                    </telerik:RadGridView.Columns>
                                </telerik:RadGridView>
                            </DataTemplate>
                        </telerik:RadGridView.RowDetailsTemplate>
                        <telerik:RadGridView.Columns >
     
                            <telerik:GridViewToggleRowDetailsColumn CellStyle="{StaticResource GridViewToggleButtonColumnStyle}" />
                            <telerik:GridViewDataColumn Header="Purpose" DataMemberBinding="{Binding Path=Consult_Purpose, Mode=OneWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, TargetNullValue=''}" Width="70" />
                            <telerik:GridViewDataColumn Header="Date" DataMemberBinding="{Binding Path=Consult_Date, Mode=OneWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, TargetNullValue=''}" Width="70"/>
                            <telerik:GridViewDataColumn Header="Next Consultation" DataMemberBinding="{Binding Path=Directions_Next_Consult, Mode=OneWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, TargetNullValue=''}" Width="70"/>
                            <telerik:GridViewDataColumn Header="Recomendations" DataMemberBinding="{Binding Path=Consult_Patient_recomendations, Mode=OneWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, TargetNullValue=''}" Width="70"/>
     
     
     
     
                        </telerik:RadGridView.Columns>
                    </telerik:RadGridView>
                </telerik:RadTabItem>
     
                <!-- end Tab  Consultas -->
            </telerik:RadTabControl>
        </Grid>
    </navigation:Page>
  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 12 Jul 2010 Link to this post

    Hello Frank,

    You just need to set a Panel (Grid, StackPanel, etc) as a first child of the TabItem and then add any content you want inside this panel.

    Please let us know if you have any other questions.

    Greetings,
    Valentin.Stoychev
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
Back to Top