DetailsPresenter styling help

7 posts, 0 answers
  1. felix
    felix avatar
    16 posts
    Member since:
    Nov 2010

    Posted 16 Jun 2011 Link to this post

    Hi there,

    I'm trying to remove the background linear gradient of this border, but no matter where I change or override, it still keeps showing up. (see attached image)

    I thought I'd be able to create an implicit style fpr the DetailsPresenterTemplate, with the border removed, but it still keeps appearing:


     
    <ControlTemplate x:Key="DetailsPresenterTemplate" TargetType="telerik:DetailsPresenter">
        <Border x:Name="DetailsBorder" BorderThickness="0">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="DetailsStates">
                    <VisualState x:Name="DetailsVisible">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DetailsBorder">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible"/>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="DetailsCollapsed"/>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <ContentPresenter x:Name="PART_ContentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
        </Border>
    </ControlTemplate>
     

    Any ideas?

    thanks!

    felix

  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 20 Jun 2011 Link to this post

    Hi Felix,

     

    Your code seems to work fine considering the fact you have defined a style which references the desired template. May you please try to isolate the problem in a small repro application and attach it to this support ticket where we can see what might be wrong. Thus we would be able to proivde you with an appropriate solution. 



    Regards,
    Vanya Pavlova
    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
  4. Jonx
    Jonx avatar
    258 posts
    Member since:
    Jul 2012

    Posted 23 Jun 2011 Link to this post

    Hello Vanya,
    I've got the same problem.
    I would like that my DetailsPresenter has no style.

    You add two borders inside my DetailsPresenter, the DetailsBorder that adds a 1 pixel border and one border that add a background with a gradient brush.

    How can I disable those two styles so that when my DetailsPresenter is visible, only my controls are displayed...
    Currently this gives an ugly raized border...
    See the attached screenshots...

    Thank you for your help,
    John.
  5. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 23 Jun 2011 Link to this post

    Hi John,

     
    I have prepared an example for you that demonstrates how this can be achieved.
    If you have any additional questions please let me know.


    Kind regards,
    Vanya Pavlova
    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
  6. Jonx
    Jonx avatar
    258 posts
    Member since:
    Jul 2012

    Posted 23 Jun 2011 Link to this post

    Excellent, thanks a lot Vanya for your nice and fast answer.

    Finally, what I use is the following:
    <ControlTemplate x:Key="DetailsPresenterTemplate" TargetType="telerik:DetailsPresenter">
       <ContentPresenter x:Name="PART_ContentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
    </ControlTemplate>
     
    <Style TargetType="telerik:DetailsPresenter">
        <Setter Property="Template" Value="{StaticResource DetailsPresenterTemplate}"/>
    </Style>

    Is there a reason why I should keep the borders in the template? I did remove them and now it's perfect.

    I would not have figured it out without your help.
    Thanks again,
    John.

  7. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 23 Jun 2011 Link to this post

    Hi John,


    When you are styling any control you may modify its appearance in the way you need. The DetailsPresenter template is  contained by a single Border element which holds some content defined by the end-user. By default this presenter has some border and background. If you do not need any border, background of RadGridView's RowDetails just remove this Border and just leave the PART_ContentPresenter.




    All the best,
    Vanya Pavlova
    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
  8. Jonx
    Jonx avatar
    258 posts
    Member since:
    Jul 2012

    Posted 23 Jun 2011 Link to this post

    Ok thank you for the explanation...
    Kind regards,
    John.
Back to Top
DevCraft banner