PivotGrid Way to disable collapsing on a ColumnGroupDescription

7 posts, 0 answers
  1. Fitz
    Fitz avatar
    5 posts
    Member since:
    Jun 2013

    Posted 23 Jan 2015 Link to this post

    Is there a way within Wpf to disable collapsing of a Column Group Description?
    I have a Type, SubType and then Aggregations. 
    Currently the user can collapse the Type on the Column Group.
    I want to prevent them from collapsing all the types and leave the last one open.
  2. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 28 Jan 2015 Link to this post

    Hi David,

    You should be able to hide the expand/collapse button by modifying the ControlTemplate of PivotGroupHeader, for example you can set the Visibility of the Grid named PART_ExpandIcon to Collapsed. However note that this will affect all the GroupHeader levels, so you might also need to use a ValueConverter in order to hide/show only the needed GroupHeaders.

    Hope this helps.

    Regards,
    Kalin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Fitz
    Fitz avatar
    5 posts
    Member since:
    Jun 2013

    Posted 29 Jan 2015 in reply to Kalin Link to this post

    Don't I need the full ControlTemplate of the radpivotgrid if I want to Change the PivotGroupHeader part of it to set the visiblity to Collapsed?

    Kalin said:Hi David,

    You should be able to hide the expand/collapse button by modifying the ControlTemplate of PivotGroupHeader, for example you can set the Visibility of the Grid named PART_ExpandIcon to Collapsed. However note that this will affect all the GroupHeader levels, so you might also need to use a ValueConverter in order to hide/show only the needed GroupHeaders.

    Hope this helps.

    Regards,
    Kalin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. Fitz
    Fitz avatar
    5 posts
    Member since:
    Jun 2013

    Posted 29 Jan 2015 in reply to Fitz Link to this post

    Never mind I used a style and set the control template on the PivotGroupHeaders.
  6. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 30 Jan 2015 Link to this post

    Hello,

    I'm glad you have managed to achieve the desired scenario. If you have any other questions, let us know.

    Regards,
    Kalin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  7. Fitz
    Fitz avatar
    5 posts
    Member since:
    Jun 2013

    Posted 30 Jan 2015 in reply to Kalin Link to this post

    This is what I used to do this, but it isn't quite right.  How do I get to the named Grid to set the Visiblity?  Or do I have to use Blend?
    This actually removed the PivotGroupHeader and replaced it with a Gird that was hidden.  I want to set the Visiblity on the Grid named PART_ExpandIcon.  Any help with it you can lend will be appreciated?

    <Style TargetType="pivot:PivotGroupHeader">
            <Setter Property="Template">
              <Setter.Value>
                <ControlTemplate TargetType="{x:Type Grid}">
                  <Grid Name="PART_ExpandIcon" Visibility="Hidden">
                  </Grid>
                </ControlTemplate>
              </Setter.Value>
            </Setter>
          </Style>
  8. Fitz
    Fitz avatar
    5 posts
    Member since:
    Jun 2013

    Posted 30 Jan 2015 in reply to Fitz Link to this post

    Here is the correct xaml:
     <Style TargetType="pivot:PivotGroupHeader">
            <Setter Property="Template">
              <Setter.Value>
                <ControlTemplate TargetType="pivot:PivotGroupHeader">
                  <Grid Name="PART_ExpandIcon" Visibility="Hidden">
                  </Grid>
                </ControlTemplate>
              </Setter.Value>
            </Setter>
          </Style>
Back to Top
UI for WPF is Visual Studio 2017 Ready