figured it out. I am posting the code for others to use it.
grid.BeginInit();
foreach(Xceed.Grid.Group grp in grid.GroupTemplates)
{
Xceed.Grid.ColumnManagerRow crow = new ColumnManagerRow();
grid.HeaderRows.Add(crow);
}
grid.UpdateGrouping();
grid.EndInit();
Imported from legacy forums. Posted by xUser (had 3579 views)