Hey,
I've bumped into a problem where sometimes on ALT+TAB data from a grid disappears as you can see on attached photo.
We managed to fix it with the code below but it requires manual screen "flashing" namely hidding and showing any of the grid's column. The view that contains the grid is once created when navigated to then saved to cache. On next navigation it is grabbed from the cache. We don't create views on every navigation.
As you can see only things that are labels disappeard.
Window? _window;
public AccountsClientsView(AccountsClientsViewModel accountsClientsViewModel, IPreferencesService preferencesService)
{
_viewModel = accountsClientsViewModel;
await Task.Yield();
BuildContent();
_viewModel.IsLoadingContent = false;
SubscribeToWindowActivation();
Unloaded += OnUnloaded;
}
void OnUnloaded(object? sender, EventArgs e)
{
Unloaded -= OnUnloaded;
UnsubscribeFromWindowActivation();
}
void SubscribeToWindowActivation()
{
_window = Window;
if (_window is not null)
_window.Activated += OnWindowActivated;
}
void UnsubscribeFromWindowActivation()
{
if (_window is null)
return;
_window.Activated -= OnWindowActivated;
_window = null;
}
// Telerik RadDataGrid on Windows stops painting its realized rows after the
// window is deactivated and reactivated (e.g. Alt+Tab); the data reappears
// only once the user scrolls. Reactivating revives each grid the same way a
// manual scroll would, keeping the current scroll position and selection.
void OnWindowActivated(object? sender, EventArgs e)
{
Dispatcher.Dispatch(() =>
{
foreach (var (grid, _) in _viewModel.Grids)
RefreshGridPreservingScroll(grid);
});
}
void RefreshGridPreservingScroll(RadDataGrid grid)
{
#if WINDOWS
// Nudge the internal ScrollViewer by 1px and back: this triggers the
// same re-virtualization a manual scroll does, so the rows repaint
// while the original vertical position is restored.
if (grid.Handler?.PlatformView is not Microsoft.UI.Xaml.FrameworkElement platformView)
return;
var scrollViewer = FindNativeScrollViewer(platformView);
if (scrollViewer is null)
return;
var offset = scrollViewer.VerticalOffset;
var nudged = offset > 1 ? offset - 1 : offset + 1;
scrollViewer.ChangeView(null, nudged, null, true);
grid.Dispatcher.DispatchDelayed(
TimeSpan.FromMilliseconds(30),
() => scrollViewer.ChangeView(null, offset, null, true));
#else
if (grid.Columns.Count == 0)
return;
var firstColumn = grid.Columns[0];
var isVisible = firstColumn.IsVisible;
firstColumn.IsVisible = !isVisible;
firstColumn.IsVisible = isVisible;
#endif
}
#if WINDOWS
static Microsoft.UI.Xaml.Controls.ScrollViewer? FindNativeScrollViewer(Microsoft.UI.Xaml.DependencyObject root)
{
var childCount = Microsoft.UI.Xaml.Media.VisualTreeHelper.GetChildrenCount(root);
for (var i = 0; i < childCount; i++)
{
var child = Microsoft.UI.Xaml.Media.VisualTreeHelper.GetChild(root, i);
if (child is Microsoft.UI.Xaml.Controls.ScrollViewer scrollViewer)
return scrollViewer;
var descendant = FindNativeScrollViewer(child);
if (descendant is not null)
return descendant;
}
return null;
}
#endif
grid.VisualStateService.PropertyChanged += (s, e) =>
{
if (e.PropertyName != nameof(grid.VisualStateService.MouseHoverCell))
return;
var cell = grid.VisualStateService.MouseHoverCell;
var model = cell?.Item as SomeModel;
grid.MouseHoverStyle = new Style(typeof(DataGridMouseHoverAppearance))
{
Setters =
{
new Setter
{
Property = DataGridBorderAppearance.BackgroundColorProperty,
Value = model.HasFutureAppointments || model.SomeOtherProperty.HasFutureAppointments
? Colors.Blue
: Colors.Red
}
}
};
};

var autoCompleteEntry = new RadAutoComplete
{
BindingContext = _viewModel,
Placeholder = $"Szukaj {field.Label}...",
FontSize = 16,
TextColor = NeucaColors.Font_CardFrame,
BackgroundColor = Colors.White,
CompletionMode = AutoCompleteCompletionMode.Contains,
SuggestMode = AutoCompleteSuggestMode.Suggest,
NoResultsMessage = $"Brak wyników dla {field.Label}",
SearchThreshold = 3,
};
autoCompleteEntry.SetBinding(RadAutoComplete.TextProperty, new Binding(
nameof(UIFieldConfig.FilterValue),
source: field,
mode: BindingMode.TwoWay
));
autoCompleteEntry.HighlightItemFunc = (filteredItems, searchText) => null;
autoCompleteEntry.TextChanged += AutoCompleteEntryOnTextChanged(field.FieldName);
autoCompleteEntry.Completed +=
dataGridContext == UIDataGridContext.Account
? AccountOnAutoCompleteEntryCompleted
: ClientOnAutoCompleteEntryCompleted;
autoCompleteEntry.SuggestionItemSelected +=
dataGridContext == UIDataGridContext.Account
? AccountOnAutoCompleteEntryOnSuggestionItemSelected
: ClientOnAutoCompleteEntryOnSuggestionItemSelected;
autoCompleteEntry.SetBinding(WidthRequestProperty, new Binding(
nameof(AccountsClientsViewModel.IsEditMode),
source: _viewModel,
converter: new BoolToObjectConverter { TrueObject = 250, FalseObject = 300 }
));
dataRow.Children.Add(autoCompleteEntry);


Hi,
I'm trying to achieve the same styling for RadAutoComplete and RadEntry. However there's a mismatch between ClearButton padding/margin or overall how it is placed.
Firstly when i try raw controlls without styles whatsover, there's noticeable difference between AutoComplete ClearButton size and RadEntry ClearButton size.
Getting the size of two icons to be the same is fairly easy reffering to the documentation however i cannot get them to display in the same place. RadEntry's icon is slightly offset to the right as if inner container had different values or something. I tried resetting margin and padding with styles as well as in the control itself.
I'm also attaching screenshots. You can see the difference there.
var radComplete = new RadAutoComplete
{
Placeholder = "Search ...",
TextColor = Colors.Black,
BackgroundColor = Colors.White,
CompletionMode = AutoCompleteCompletionMode.Contains,
SuggestMode = AutoCompleteSuggestMode.Suggest,
NoResultsMessage = "No matches ..",
SearchThreshold = 3,
ItemsSource = new List<string>
{
"Apple", "Apple1", "Apple2", "Apple3", "Apple4", "Apple5", "Banana", "Cherry", "Date", "Elderberry"
},
ClearButtonStyle = new Style(typeof(RadTemplatedButton))
{
Setters =
{
// new Setter
// {
// Property = RadTemplatedButton.PaddingProperty,
// Value = 0
// },
// new Setter
// {
// Property = RadTemplatedButton.MarginProperty,
// Value = 0
// },
new Setter
{
Property = RadTemplatedButton.BackgroundColorProperty,
Value = Colors.Red
},
new Setter
{
Property = VisualStateManager.VisualStateGroupsProperty,
Value = new VisualStateGroupList
{
new VisualStateGroup
{
Name = "CommonStates",
States =
{
new VisualState { Name = "Normal" },
}
}
}
},
}
},
TextInputStyle = new Style(typeof(RadTextInput))
{
Setters =
{
new Setter { Property = RadTextInput.MinimumHeightRequestProperty, Value = 44 },
new Setter { Property = RadTextInput.MaximumHeightRequestProperty, Value = 44 }
}
}
};
var radEntry = new RadEntry
{
Placeholder = "Search ...",
TextColor = Colors.Black,
BackgroundColor = Colors.White,
HeightRequest = 44,
ClearButtonStyle = new Style(typeof(RadTemplatedButton))
{
Setters =
{
// new Setter
// {
// Property = RadTemplatedButton.PaddingProperty,
// Value = 0
// },
// new Setter
// {
// Property = RadTemplatedButton.MarginProperty,
// Value = 0
// },
new Setter
{
Property = RadTemplatedButton.BackgroundColorProperty,
Value = Colors.Red
},
new Setter
{
Property = VisualStateManager.VisualStateGroupsProperty,
Value = new VisualStateGroupList
{
new VisualStateGroup
{
Name = "CommonStates",
States =
{
new VisualState { Name = "Normal" },
}
}
}
},
}
},
Style = new Style(typeof(RadEntry))
{
Setters =
{
new Setter
{
Property = VisualStateManager.VisualStateGroupsProperty,
Value = new VisualStateGroupList
{
new VisualStateGroup
{
Name = "CommonStates",
States =
{
new VisualState { Name = "Normal" },
}
}
}
},
}
}
};


Hello!
We have recently updated our MAUI app from Telerik 13.2 to the latest 14 version. After the update, our Android app would crash on startup.
Our logs suggested the issue came from the RadSpinnerResourceDictionary class, specifically the setting the TextColorProperty now calls resourceExtension.ProvideValue() method which expects the value of the key added in the constructor:
public RadSpinnerResourceDictionary()
{
this.Add("SpinnerSelectedTextColor", (object) Application.AccentColor);
this.InitializeComponent();
}We do not set this value, and the value is nullable.
In our Styles.xml we have a custom style for the RadListPicker. The app crashes if we leave that set, and does not if we comment out the style. However, the app experiences a weird behavior afterwards, where native controls (buttons, pickers) do not render correctly or at all.
Here is the log we have:
System.NullReferenceException: Object reference not set to an instance of an object.
at object StaticResourceExtension.CastTo(object value, object targetProperty)() in StaticResourceExtension.cs:line 62
at object StaticResourceExtension.ProvideValue(IServiceProvider serviceProvider)() in StaticResourceExtension.cs:line 53
at void RadSpinnerResourceDictionary.InitializeComponent()()
at new RadSpinnerResourceDictionary()()
at static RadSpinner()()
System.TypeInitializationException: The type initializer for 'Telerik.Maui.Controls.RadSpinner' threw an exception.
at void RadPickersResources.InitializeComponent()()
at new RadPickersResources()()
at RadPickersResources RadPickersResources.get_Resources()()
at object RadPickersResources.GetResource(string resourceKey)()
at Style RadPickersResources.get_PickerContentViewHeaderLabelStyle()()
at static PickerPopupSettings()()
System.TypeInitializationException: The type initializer for 'Telerik.Maui.Controls.PickerPopupSettings' threw an exception.
at object MethodBaseInvoker.InterpretedInvoke_Constructor(object obj, IntPtr* args)() in MethodBaseInvoker.Mono.cs:line 32
at object MethodBaseInvoker.InvokeWithNoArgs(object obj, BindingFlags invokeAttr)() in MethodBaseInvoker.cs:line 57
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
at object MethodBaseInvoker.InvokeWithNoArgs(object obj, BindingFlags invokeAttr)() in MethodBaseInvoker.cs:line 61
at object RuntimeType.CreateInstanceMono(bool nonPublic, bool wrapExceptions)() in RuntimeType.Mono.cs:line 1825
at object RuntimeType.CreateInstanceDefaultCtor(bool publicOnly, bool wrapExceptions)() in RuntimeType.Mono.cs:line 1627
at object Activator.CreateInstance(Type type, bool nonPublic, bool wrapExceptions) x 3() in Activator.RuntimeType.cs:line 97
at void CreateValuesVisitor.Visit(ElementNode node, INode parentNode)() in CreateValuesVisitor.cs:line 113
at void ElementNode.Accept(IXamlNodeVisitor visitor, INode parentNode)() in XamlNode.cs:line 142
at void ElementNode.Accept(IXamlNodeVisitor visitor, INode parentNode) x 2() in XamlNode.cs:line 138
at void RootNode.Accept(IXamlNodeVisitor visitor, INode parentNode)() in XamlNode.cs:line 194
at void XamlLoader.Visit(RootNode rootnode, HydrationContext visitorContext, bool useDesignProperties)() in XamlLoader.cs:line 233
at void XamlLoader.Load(object view, string xaml, Assembly rootAssembly, bool useDesignProperties)() in XamlLoader.cs:line 103
at void XamlLoader.Load(object view, string xaml, bool useDesignProperties)() in XamlLoader.cs:line 57
at void XamlLoader.Load(object view, Type callingType)() in XamlLoader.cs:line 53
at __TypeAC55B29C835AE2FB Extensions.LoadFromXaml<__TypeAC55B29C835AE2FB>(__TypeAC55B29C835AE2FB view, Type callingType)() in ViewExtensions.cs:line 52
at void __TypeAC55B29C835AE2FB.InitializeComponent()() in obj/Debug/net10.0-android/android-arm64/Microsoft.Maui.Controls.SourceGen/Microsoft.Maui.Controls.SourceGen.XamlGenerator/Resources_Styles_Styles.xaml.sg.cs:line 24
at new __TypeAC55B29C835AE2FB()() in obj/Debug/net10.0-android/android-arm64/Microsoft.Maui.Controls.SourceGen/Microsoft.Maui.Controls.SourceGen.XamlGenerator/Resources_Styles_Styles.xaml.sg.cs:line 18
at object MethodBaseInvoker.InterpretedInvoke_Constructor(object obj, IntPtr* args)() in MethodBaseInvoker.Mono.cs:line 32
at object MethodBaseInvoker.InvokeWithNoArgs(object obj, BindingFlags invokeAttr)() in MethodBaseInvoker.cs:line 57
at ResourceDictionary ResourceDictionary.GetOrCreateInstance(Type type)+(Type _) => { }() in ResourceDictionary.cs:line 95
at ResourceDictionary ConditionalWeakTable<Type, ResourceDictionary>.GetValue(Type key, CreateValueCallback createValueCallback)() in ConditionalWeakTable.cs:line 314
at ResourceDictionary ResourceDictionary.GetOrCreateInstance(Type type)() in ResourceDictionary.cs:line 87
at void ResourceDictionaryHelpers.SetAndLoadSource(ResourceDictionary rd, Uri value, string resourcePath, Assembly assembly, IXmlLineInfo lineInfo)() in ResourceDictionaryHelpers.cs:line 42
at void ResourceDictionaryHelpers.LoadFromSource(ResourceDictionary rd, string value, Type rootType, IXmlLineInfo lineInfo)() in ResourceDictionaryHelpers.cs:line 35
at void ApplyPropertiesVisitor.SetPropertyValue(object xamlelement, XmlName propertyName, object value, object rootElement, INode node, HydrationContext context, IXmlLineInfo lineInfo)() in ApplyPropertiesVisitor.cs:line 372
at void ApplyPropertiesVisitor.Visit(ValueNode node, INode parentNode)() in ApplyPropertiesVisitor.cs:line 70
at void ValueNode.Accept(IXamlNodeVisitor visitor, INode parentNode)() in XamlNode.cs:line 61
at void ElementNode.Accept(IXamlNodeVisitor visitor, INode parentNode)() in XamlNode.cs:line 136
at void FillResourceDictionariesVisitor.Visit(ElementNode node, INode parentNode)() in FillResourceDictionariesVisitor.cs:line 66
at void ElementNode.Accept(IXamlNodeVisitor visitor, INode parentNode)() in XamlNode.cs:line 131
at void ListNode.Accept(IXamlNodeVisitor visitor, INode parentNode)() in XamlNode.cs:line 212
at void ElementNode.Accept(IXamlNodeVisitor visitor, INode parentNode)() in XamlNode.cs:line 136
at void RootNode.Accept(IXamlNodeVisitor visitor, INode parentNode)() in XamlNode.cs:line 192
at void XamlLoader.Visit(RootNode rootnode, HydrationContext visitorContext, bool useDesignProperties)() in XamlLoader.cs:line 236
at void XamlLoader.Load(object view, string xaml, Assembly rootAssembly, bool useDesignProperties)() in XamlLoader.cs:line 103
at void XamlLoader.Load(object view, string xaml, bool useDesignProperties)() in XamlLoader.cs:line 57
at void XamlLoader.Load(object view, Type callingType)() in XamlLoader.cs:line 53
at App Extensions.LoadFromXaml<App>(App view, Type callingType)() in ViewExtensions.cs:line 52
at void App.InitializeComponent()() in obj/Debug/net10.0-android/android-arm64/Microsoft.Maui.Controls.SourceGen/Microsoft.Maui.Controls.SourceGen.XamlGenerator/App.xaml.sg.cs:line 20
at new App()() in App.xaml.cs:line 247
at object MethodBaseInvoker.InterpretedInvoke_Constructor(object obj, IntPtr* args)() in MethodBaseInvoker.Mono.cs:line 32
at object MethodBaseInvoker.InvokeWithNoArgs(object obj, BindingFlags invokeAttr)() in MethodBaseInvoker.cs:line 57
at object RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)() in RuntimeConstructorInfo.cs:line 155
at object CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)() in CallSiteRuntimeResolver.cs:line 69
at object CallSiteVisitor<RuntimeResolverContext, object>.VisitCallSiteMain(ServiceCallSite callSite, RuntimeResolverContext argument)() in CallSiteVisitor.cs:line 48
at object CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)() in CallSiteRuntimeResolver.cs:line 92
at object CallSiteVisitor<RuntimeResolverContext, object>.VisitCallSite(ServiceCallSite callSite, RuntimeResolverContext argument)() in CallSiteVisitor.cs:line 27
at object CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)() in CallSiteRuntimeResolver.cs:line 30
at ServiceAccessor ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier)() in ServiceProvider.cs:line 251
at ServiceAccessor ConcurrentDictionary<ServiceIdentifier, ServiceAccessor>.GetOrAdd(ServiceIdentifier key, Func<ServiceIdentifier, ServiceAccessor> valueFactory)() in ConcurrentDictionary.cs:line 1201
at object ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope) x 2() in ServiceProvider.cs:line 211
at object WrappedServiceProvider.GetService(Type serviceType) x 2() in MauiContext.cs:line 87
at IApplication ServiceProviderServiceExtensions.GetService<IApplication>(IServiceProvider provider)() in ServiceProviderServiceExtensions.cs:line 25
at void SentryMauiAppBuilderExtensions.HandleMauiEvents(IPlatformApplication platformApplication, bool bind)() in SentryMauiAppBuilderExtensions.cs:line 158
at void <>c.<RegisterMauiEventsBinder>b__3_2(?)+(Application application) => { }() in SentryMauiAppBuilderExtensions.cs:line 134
at void MauiApplication.OnCreate()+(OnApplicationCreating del) => { }() in MauiApplication.cs:line 44
at void LifecycleEventServiceExtensions.InvokeLifecycleEvents<OnApplicationCreating>(IServiceProvider services, Action<OnApplicationCreating> action)() in LifecycleEventServiceExtensions.cs:line 31
at void MauiApplication.OnCreate()() in MauiApplication.cs:line 44
at void Application.n_OnCreate(IntPtr jnienv, IntPtr native__this)()Setting the Application.AccentColor in App.xaml.cs before InitializeComponent(); seems to fix the issue.
If the previous behavior is expected to change, this should be marked as a breaking change.

I have a button that users can click to clear the filters on a RadDataGrid using datagrid.FilterDescriptors.Clear()
This clears the filters on the grid, however if I look at a column that was previously filtered, I see the previous settings. How do I reset the filter settings on the columns?

Hi All
Was hoping if anybody can give their input on a problem I'm having.
I have some sort of VMS in Maui made using libVLC
But I have ran into issues increasing stream count.
Up to 24 streams no issues, but as soon as the 25th stream hits my CPU load spikes like crazy.
I go from like 15% CPU load to 70%.
I have done something similar in WPF which went fine on even 66 streams. I know WPF is not the same but libvlc isn't the issue.
Small sidenote a made a test in WinUI3 40 streams loaded fine with only 15% CPU load.
Does anybody know how valid the below is?
Each MAUI VideoView creates its own SwapChainPanel = its own DXGI swap chain. 28 streams = 28 swap chains feeding
the WinUI DirectComposition compositor, which chokes past ~25. WPF doesn't have this problem because it uses a
single shared D3DImage surface — one compositor target for all streams.
Switch LibVLC from the built-in VideoView (one SwapChainPanel each) to callback rendering (SetVideoFormat +
SetVideoCallbacks), then composite all streams into 1–4 shared SwapChainPanels as tiles. Same RTSP URLs, same HW
decode, same FPS/resolution. Just one compositor target instead of 30.
Thanks
