I have a sorted data grid. By default it displays everything collapsed.
By handling the InitializeRecord event in the code-behind file I can set Record.IsExpanded = true and get the grid to display everything expanded at startup.
How can I do the same thing in XAML?
Thanks,
- Dave
You should not set key to the style so that it would be applied by default. Also, if you have set a theme for the XamDataPresenter, you should put that style in the Resources section of the XamDataGrid itself, because WPF support only one local style.
Alex.
Thanks for the quick reply!
Here's a more basic question: How do I get to the DataRecordPresenter properly?
I've implemented the example from the Help page that puts buttons in cells of a data grid.
I've created a style as follows:
<Style TargetType="{x:Type igDP:DataRecordPresenter}">
<Setter Property="IsEnabled" Value="True" />
</Style>
Shouldn't this automatically apply to all igDP:DataRecordPresenter objects in the system?
Or do I need to specify an x:Key in the Style? If so, where in the XamDataGrid definition to I reference this key?
Hello Dave,
You can create a style for the DataRecordPresenter and add a setter for IsExpanded property to true.
You can also use a EventTrigger and use igDP:XamDataGrid.Loaded event to expand them with the same setter.
Hope this helps,