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

DetailsPresenter styling help

6 Answers 73 Views
GridView
This is a migrated thread and some comments may be shown as answers.
felix
Top achievements
Rank 1
felix asked on 16 Jun 2011, 11:00 AM
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

6 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 20 Jun 2011, 10:24 AM
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
0
Jonx
Top achievements
Rank 2
answered on 23 Jun 2011, 10:16 AM
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.
0
Vanya Pavlova
Telerik team
answered on 23 Jun 2011, 12:00 PM
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
0
Jonx
Top achievements
Rank 2
answered on 23 Jun 2011, 01:32 PM
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.

0
Vanya Pavlova
Telerik team
answered on 23 Jun 2011, 02:04 PM
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
0
Jonx
Top achievements
Rank 2
answered on 23 Jun 2011, 03:15 PM
Ok thank you for the explanation...
Kind regards,
John.
Tags
GridView
Asked by
felix
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Jonx
Top achievements
Rank 2
Share this question
or