Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
340
ContextMenu in Grouped Row
posted

Hi,

I would like to be able to display a context menu in a grouped row.

Can someone help me with this?

Thanks,

Fede

  • 69686
    Verified Answer
    posted

    Hello Fede,

    You can use a style for the GroupByRecordPresenter and set the ContextMenu in the style, like this:

          <ContextMenu x:Key="contextmenu">

                <MenuItem Header="Expand"/>

                <MenuItem Header="Collapse"/>

            </ContextMenu>

            <Style TargetType="{x:Type my:GroupByRecordPresenter}">

                <Setter Property="ContextMenu" Value="{StaticResource contextmenu}"/>

            </Style>

    You can also achieve this dynamically in procedural code, which you can see how to do here