Make Column Header Invisible

3 posts, 1 answers
  1. Evan
    Evan avatar
    8 posts
    Member since:
    Sep 2017

    Posted 28 Nov Link to this post

    I am trying to make a DataGrid with only one DataGridTextColumn. I do not want a header for this column, is there a flag or someway of making it invisible?

    Thanks,

    Evan

  2. Answer
    Lance | Tech Support Engineer, Sr.
    Admin
    Lance | Tech Support Engineer, Sr. avatar
    488 posts

    Posted 29 Nov Link to this post

    Hi Evan,

    Currently there isn't a "HeaderVisibility" property for the DataGrid column types (see the properties list here).

    However, you can achieve this by using a custom HeaderTemplate in conjunction with a HeaderStyle, try this for example:

    <dataGrid:DataGridTextColumn PropertyName="Title">
        <dataGrid:DataGridTextColumn.HeaderStyle>
            <dataGrid:DataGridColumnHeaderStyle BorderColor="Transparent"
                                                BorderThickness="0"
                                                BackgroundColor="Transparent"
                                                TextMargin="0"
                                                ... />
        </dataGrid:DataGridTextColumn.HeaderStyle>
        <dataGrid:DataGridTextColumn.HeaderContentTemplate>
            <DataTemplate>
                <Grid Padding="0"
                      Margin="0" />
            </DataTemplate>
        </dataGrid:DataGridTextColumn.HeaderContentTemplate>
    </dataGrid:DataGridTextColumn>


    Regards,
    Lance | Tech Support Engineer, Sr.
    Progress Telerik
    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 Feedback Portal and vote to affect the priority of the items
  3. Evan
    Evan avatar
    8 posts
    Member since:
    Sep 2017

    Posted 29 Nov in reply to Lance | Tech Support Engineer, Sr. Link to this post

    Thank you this worked for our needs
Back to Top