Home Forums WPF controls Xceed DataGrid for WPF ColumnManagerCell Style

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #22478 |

    Hello,

    I’m trying to have different styles on the ColumnManagerCells, I made a template where a Menu is displayed in the header of each column, however I don´t want it to appear in every column.

    How can I select the columns where I want to display this style?
    Here is my style code…

    <Style TargetType=”{x:Type xcdg:ColumnManagerCell}”>
    <Setter Property=”xcdg:ColumnManagerCell.Template”>
    <Setter.Value>
    <ControlTemplate>
    <Border Style=”{StaticResource ColumnManagerStyle}”>
    <DockPanel Cursor=”Hand”>
    <Menu DockPanel.Dock=”Bottom” Height=”13″ Width=”30″ Background=”{StaticResource RadialOrangeStyle}” BorderBrush=”#AAF9D28A” BorderThickness=”1″ >
    <MenuItem x:Name=”menumenu” Height=”15″ Width=”30″ HorizontalAlignment=”Stretch” VerticalAlignment=”Center” ItemsSource=”{Binding Source={StaticResource src}, Path=MenuCollection}” >
    <MenuItem.Icon>
    <Image Source=”D:\Imag\My Testing\Images\invtriagle.png” Stretch=”None” HorizontalAlignment=”Center” VerticalAlignment=”Stretch” Width=”20.6″ Height=”17.167″/>
    </MenuItem.Icon>
    </MenuItem>
    </Menu>
    <TextBlock DockPanel.Dock=”Bottom” Text=”{TemplateBinding xcdg:ColumnManagerCell.Content}” TextAlignment=”Center” VerticalAlignment=”Center” />
    </DockPanel>
    </Border>
    </ControlTemplate>
    </Setter.Value>
    </Setter>
    </Style>

    Imported from legacy forums. Posted by Lilian (had 3621 views)

    Xceed Support
    Member
    Post count: 5658

    Column derives from DependencyObject, you could create an attached DP and place a trigger in your ControlTemplate to display or not the menu based on the value of the attached DP.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 330 views)

    User (Old forums)
    Member
    Post count: 23064

    Sorry but i’m not quite good yet on this…. could you show me a little example here?

    Imported from legacy forums. Posted by Lilian (had 244 views)

    Xceed Support
    Member
    Post count: 5658

    You can refer to <a href=”http://www.wpfwiki.com”>http://www.wpfwiki.com</a&gt; if you need some help and/or information on Attached Properties.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 307 views)

    Xceed Support
    Member
    Post count: 5658

    particularly: FAQ post 7.6 and 7.8

    Imported from legacy forums. Posted by Marcus [Xceed] (had 4359 views)

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.