wpf datagrid expand all not working

I think you need to set the UpdateSource Trigger to "PropertyChanged" when binding to the Expanded Property.

    <Expander Background="Lavender" IsExpanded="{Binding Expanded, UpdateSourceTrigger=PropertyChanged}">
                                    <Expander.Header>
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="{Binding Path=Name}" Padding="0,0,5,0" FontWeight="Bold" />
                                            <TextBlock Text="{Binding Path=ItemCount}" Padding="0,0,5,0"/>
                                            <TextBlock Text="Commandes"/>
                                        </StackPanel>
                                    </Expander.Header>
                                    <ItemsPresenter />
                                </Expander>