Question: I have a Xamdatagrid having hierarchical data.I want to display all such records expended automatically.So that user doesn't have to click on + icon for each record.

Answer: 
You can handle the XamDataGrid's InitializeRecord event (or override OnInitializeRecord) like so:

```
    void grid_InitializeRecord(object sender, Infragistics.Windows.DataPresenter.Events.InitializeRecordEventArgs e)
    {
        grid.ExecuteCommand(DataPresenterCommands.ToggleRecordIsExpanded, e.Record);
    }

```

There's also DataPresenterCommands.ExpandRecord, which expands the grid's ActiveRecord.
The above answer is good but for those who prefer to see this as a defined behavior, here's another take at it:

```
public class AutoExpandXamDataGridRecordBehavior : Behavior<XamDataGrid>
{
    protected override void OnAttached()
    {
        if (AssociatedObject is XamDataGrid grid)
        {
            grid.InitializeRecord += OnInitializeRecord;
        }
    }

    protected override void OnDetaching()
    {
        if (AssociatedObject is XamDataGrid grid)
        {
            grid.InitializeRecord -= OnInitializeRecord;
        }
    }

    private void OnInitializeRecord(object sender, InitializeRecordEventArgs e)
    {
        ((XamDataGrid)sender).ExecuteCommand(DataPresenterCommands.ToggleRecordIsExpanded, e.Record);
    }
}

```