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

Styling DataForm to remove top and bottom lines

6 Answers 202 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 20 Jun 2011, 01:42 PM
Is there a way to completely remove the top and bottom lines from the datafrom?

I would like to have 4 datafroms bellow each other that will esentially look as there is only one.

I have tried setting the border property to 0 but i still see the lines. I think it is in fact the header. I put nothing inside the header but i think it leaves a little thick line.

Any way of removing that?

<telerik:RadDataForm x:Name="RadClientDetails" CurrentItem="{Binding SelectedOrganisation}" AutoGenerateFields="True" BeginningEdit="RadClientDetails_BeginningEdit" CommandButtonsVisibility="Edit" BorderThickness="0"/>
<telerik:RadDataForm x:Name="RadOfficeAddress" CurrentItem="{Binding PrimaryAddress}" AutoGenerateFields="True" CommandButtonsVisibility="None" BorderThickness="0"/>
<telerik:RadDataForm x:Name="RadOfficeFax" CurrentItem="{Binding PrimaryFaxNumber}" AutoGenerateFields="True" CommandButtonsVisibility="Commit,Cancel" EditEnded="RadOfficeFax_EditEnded" BorderThickness="0"/>

6 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 20 Jun 2011, 01:56 PM
Hello Andrew,

 

As far as I can understand you need a completely "borderless" controls over each other. 
I have tried to replicate such a behavior by my side, but I am not sure for which Border element you are talking about. If you create a style targeted at RadDataForm and set its BorderThickness property to 0, the outer border will be removed. Looking at the template structure of RadDataForm you may see a CollectionNavigator control which has a specified BorderThickness. You may remove its Border in a similar way using a simple style. In any other case you should edit the template of RadDataForm and remove these borders by your side.
Once you have created an implict style targeted at RadDataForm it will be applied to all forms in your application. 
I am attaching you sample application which I used for testing.


I look forward to hearing from you!


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
Andrew
Top achievements
Rank 1
answered on 20 Jun 2011, 03:04 PM

Almost there, but it still appears to leave a line in between the controls.
How can i get rid of that?

Thanks.

0
Vanya Pavlova
Telerik team
answered on 20 Jun 2011, 03:13 PM
Hello Andrew,

 
As I tried to propose in my previous reply if a simple style targeted either at RadDataForm or at CollectionNavigator does not satisfy your personall requirements you have to edit the template of RadDataForm. This border comes from an element around ItemsScrollViewer, just remove it and it will dissappear:

<ScrollViewer x:Name="PART_ItemsScrollViewer" Grid.Row="2" ScrollViewer.HorizontalScrollBarVisibility="Auto" IsTabStop="False" telerik:StyleManager.Theme="{StaticResource Theme}" ScrollViewer.VerticalScrollBarVisibility="Auto">
                    <StackPanel Orientation="Vertical">
                        <Telerik_Windows_Controls_Data_DataForm:AutoGeneratedFieldsPresenter x:Name="PART_AutoGeneratedFieldsPresenter" AutoGenerateFields="{Binding AutoGenerateFields, RelativeSource={RelativeSource TemplatedParent}}" CurrentItem="{Binding CurrentItem}" telerik:StyleManager.Theme="{StaticResource Theme}"/>
                        <ContentPresenter x:Name="PART_FieldsContentPresenter" Content="{Binding CurrentItem}"/>
                    </StackPanel>
                </ScrollViewer>

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
Andrew
Top achievements
Rank 1
answered on 20 Jun 2011, 03:26 PM

It is the box where the Commit and Cancel buttons reside.
The CollectionNavigator from your code removes the border from the top part of the DataForm
The regular border thickness removes the border around the whole control.
But there appears to be a border or just one line around the footer where the buttons sit.

What is the area called and how can i assign the border thickness to zero for that area?

0
Accepted
Vanya Pavlova
Telerik team
answered on 20 Jun 2011, 03:30 PM
Hi Andrew,



This is the border element around the PART_ItemsScrollViewer just remove the border, but the style targeted at CollectionNavigator remains. Please find attached sample project that demonstrates how this can be achieved.



Best wishes,
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
Andrew
Top achievements
Rank 1
answered on 20 Jun 2011, 03:58 PM

Thank you for this.
It seems to me like a lot of code to remove one border.

Tags
DataForm
Asked by
Andrew
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Andrew
Top achievements
Rank 1
Share this question
or