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

ItemTemplate problem

3 Answers 74 Views
DataBoundListBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Park
Top achievements
Rank 1
Park asked on 31 Jan 2012, 06:19 AM
hi

i using RadDataBoundListBox in PanoramaItem.

It is normal view when design time, but item (HorizontalAlignment = Right) by runtime.
Only one page problem.

<!--ItemTemplate-->
 <DataTemplate x:Key="RecentDataTemplate">
  <Grid Background="Red">
   <Grid.ColumnDefinitions>
    <ColumnDefinition Width="0.38*"/>
    <ColumnDefinition Width="0.62*"/>
   </Grid.ColumnDefinitions>
   <TextBlock Text="{Binding SearchKind, Converter={StaticResource SearchKindToTextConverter}}" Style="{StaticResource SingleLineSmallTextBlockStyle}" Margin="12,0,27,12" />
   <TextBlock TextWrapping="Wrap" Text="{Binding SearchData}" Style="{StaticResource SingleLineTextBlockStyle}" Grid.Column="1" Margin="12,0,27,12" />
  </Grid>
 </DataTemplate>

   <!--PanoramaItem & RadDataBoundListBox-->
   <controls:PanoramaItem Header="{Binding LocalizedResources.AppMain3SubLable, Source={StaticResource LocalizedStrings}}">
    <telerikPrimitives:RadDataBoundListBox EmptyContent="최근 검색 내용이 없습니다." ItemTemplate="{StaticResource RecentDataTemplate}" ItemsSource="{Binding SearchDataCollection}">
    </telerikPrimitives:RadDataBoundListBox>
   </controls:PanoramaItem>

How can i do?
thank you

this problem solve

it is maybe ItemContainer problem(why different design-time and run-time container?)
i add ItemContainerStyle.

 <!--데이터바운드리스트박스 아이템 컨테이너 스타일1, 줄간 간격 많이 띄움-->
    <Style x:Key="TouchItemContainerStyle1" TargetType="telerikPrimitives:RadDataBoundListBoxItem">
     <Setter Property="Background" Value="Transparent"/>
     <Setter Property="BorderThickness" Value="0"/>
     <Setter Property="BorderBrush" Value="Transparent"/>
     <Setter Property="Padding" Value="0"/>
     <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
     <Setter Property="VerticalContentAlignment" Value="Stretch"/>
     <Setter Property="CacheMode" Value="BitmapCache"/>
     <Setter Property="Template">
      <Setter.Value>
       <ControlTemplate TargetType="telerikPrimitives:RadDataBoundListBoxItem">
        <Border x:Name="LayoutRoot" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
         <VisualStateManager.VisualStateGroups>
          <VisualStateGroup x:Name="CommonStates">
           <VisualState x:Name="Normal"/>
           <VisualState x:Name="MouseOver"/>
           <VisualState x:Name="Disabled">
            <Storyboard>
             <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="LayoutRoot">
              <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TransparentBrush}"/>
             </ObjectAnimationUsingKeyFrames>
             <DoubleAnimation Duration="0" To=".5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_ContainerHolder"/>
            </Storyboard>
           </VisualState>
          </VisualStateGroup>
          <VisualStateGroup x:Name="SelectionStates">
           <VisualState x:Name="Unselected"/>
           <VisualState x:Name="Selected">
            <Storyboard>
             <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="PART_ContainerHolder">
              <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneAccentBrush}"/>
             </ObjectAnimationUsingKeyFrames>
            </Storyboard>
           </VisualState>
          </VisualStateGroup>
         </VisualStateManager.VisualStateGroups>
         <Grid Margin="12,0,12,25" HorizontalAlignment="Left">
          <ContentControl x:Name="PART_ContainerHolder" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="Right" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
         </Grid>
        </Border>
       </ControlTemplate>
      </Setter.Value>
     </Setter>
    </Style>

3 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 31 Jan 2012, 04:44 PM
Hi Park,

I am not quite sure that I correctly understand the issue here.

Is your problem related to the fact that you see different layout while in runtime compared to what's on the screen in the designer? I yes, are there any additional styling adjustments that you perform in the code of your application when it runs?

It will be very helpful if you manage to attach a demo project that we can use to take a look at the issue.

Thanks for your time.

Greetings,
Deyan
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Park
Top achievements
Rank 1
answered on 04 Feb 2012, 04:02 PM
hi Deyan

yes it is issue in control
many problem design-time and run-time  different view

but, i solve this problem now. (how can i do it -> Is on the tip of my )
if you want source, can send email.

Currently the 'Korea Bus Infomation 2.0' app is under development.
sent to the source can give Telerik

have a good day
0
Deyan
Telerik team
answered on 06 Feb 2012, 10:01 AM
Hello Park,

For now, we will consider this thread close.

Do not hesitate to get back to us in case you experience further difficulties or need assistance.

Regards,
Deyan
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
DataBoundListBox
Asked by
Park
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Park
Top achievements
Rank 1
Share this question
or