Posted 7 days ago by Michael Janulaitis - Corner Bowl Software
Avatar

My DataGrids will only display if I include the Simple Theme include in my app.xaml, for example:

<StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Simple.xaml"/>

Without the include statment, the datagrid does not display.  I don't see that include statement in the samples and would expect the control to internally apply it's own styles.  I think I am missing a step.  I made sure to include the datagrid nuget package:

<PackageReference Include="ActiproSoftware.Controls.Avalonia.Themes.DataGrid" Version="24.1.0" />

Comments (5)

Posted 7 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Michael,

You won't need the Simple theme if you tell our products to include our DataGrid theme, which is in a separate optional assembly.  The instructions on doing that are here:

https://www.actiprosoftware.com/docs/controls/avalonia/themes/native-control-themes#configuring-2


Actipro Software Support

Posted 7 days ago by Michael Janulaitis - Corner Bowl Software
Avatar

Thanks so much so my config looks like this and it's working as expected:

<actipro:ModernTheme Includes="Pro, NativeDataGrid">

Posted 7 days ago by Michael Janulaitis - Corner Bowl Software
Avatar

Ok now that my DataGrids are displaying, I am porting a WPF application and have overridden the DataGrid with an abstract class then on top of that a concrete class.  When I use my concrete Super Class instead of the Base DataGrid class the DataGrid no longer displays.  How can I get the control to display when overridden?

[Modified 7 days ago]

Posted 6 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Avalonia controls are the opposite of WPF in that they require a define theme for the control by default, whereas WPF inherits control themes (WPF styles) from base classes by default.  To get an Avalonia control to inherit a base class theme, add this:

protected override Type StyleKeyOverride 
	=> typeof(DataGrid);


Actipro Software Support

Posted 5 days ago by Michael Janulaitis - Corner Bowl Software
Avatar

That's right I forgot about that.  Thanks!

Add Comment

Please log in to a validated account to post comments.