wpf datagrid grouping code behind





Im new in WPF. Im following MVVM pattern. Developing application to show list of employees, Im planning to use datagrid control.is there any way to group the list using datagrid? Since I want to follow MVVM pattern, I want to achieve using xaml only and not in code behind file? I want make a footer to my DataGrid using this method: How do I add a footer row in a WPF datagrid? But, i need to make this by code behind, and thats dont working.GroupStyle>