Styling DataForm to remove top and bottom lines

7 posts, 1 answers
  1. Andrew
    Andrew avatar
    171 posts
    Member since:
    Jun 2009

    Posted 20 Jun 2011 Link to this post

    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"/>
  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 20 Jun 2011 Link to this post

    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
  3. DevCraft banner
  4. Andrew
    Andrew avatar
    171 posts
    Member since:
    Jun 2009

    Posted 20 Jun 2011 Link to this post

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

    Thanks.

  5. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 20 Jun 2011 Link to this post

    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
  6. Andrew
    Andrew avatar
    171 posts
    Member since:
    Jun 2009

    Posted 20 Jun 2011 Link to this post

    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?

  7. Answer
    Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 20 Jun 2011 Link to this post

    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
  8. Andrew
    Andrew avatar
    171 posts
    Member since:
    Jun 2009

    Posted 20 Jun 2011 Link to this post

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

Back to Top
DevCraft banner