stride3d/stride · error · InvalidOperationException
A part named 'PART_EditableTextBox' must be present in the…
Error message
A part named 'PART_EditableTextBox' must be present in the ControlTemplate, and must be of type 'Stride.Core.Presentation.Controls.Input.TextBox'.
What it means
FilteringComboBox.OnApplyTemplate fetches the mandatory template part 'PART_EditableTextBox' and requires it to be the library's Stride TextBox type, wiring text-change/key/event handlers onto it. A missing or wrong-type part makes the combo non-functional, so it throws InvalidOperationException. A second check for PART_ListBox follows.
Solutions
- Include an element named PART_EditableTextBox of type Stride.Core.Presentation.Controls.Input.TextBox in the ControlTemplate.
- Replace any System.Windows.Controls.TextBox used under that name with the Stride TextBox (it exposes TextChanged/Validating/Cancelled events).
- Restore the default template from the Stride theme dictionary and re-apply customizations.
Example fix
<!-- before -->
<TextBox x:Name="PART_EditableTextBox"/>
<!-- after -->
<presentation:TextBox x:Name="PART_EditableTextBox"
xmlns:presentation="http://schemas.stride3d.net/xaml/presentation"/> Defensive patterns
Strategy: validation
Validate before calling
var tb = combo.Template?.FindName("PART_EditableTextBox", combo);
if (tb is not Stride.Core.Presentation.Controls.Input.TextBox)
throw new InvalidOperationException("Template needs a Stride TextBox named PART_EditableTextBox."); Type guard
bool HasEditableTextBoxPart(FilteringComboBox combo) => combo.Template?.FindName("PART_EditableTextBox", combo) is Stride.Core.Presentation.Controls.Input.TextBox; Try / catch
try { combo.ApplyTemplate(); }
catch (InvalidOperationException ex) { log.Error("FilteringComboBox template missing parts", ex); } Prevention
- Use Stride's TextBox (not System.Windows.Controls.TextBox) for the editable part.
- Keep the exact part names PART_EditableTextBox and PART_ListBox.
- Derive custom templates from the shipped theme template.
When it happens
Trigger: Applying a ControlTemplate for FilteringComboBox that omits the element named PART_EditableTextBox, names it differently, or uses a plain System.Windows.Controls.TextBox instead of Stride's Stride.Core.Presentation.Controls.Input.TextBox.
Common situations: Re-templating FilteringComboBox from scratch; copying the default template but dropping or retyping the editable textbox part; theme resources missing so the default template isn't applied.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- A part named ' ' must be present in the ControlTemplate…
- A part named 'PART_ListBox' must be present in the…
- A part named 'PART_TrimmedText' must be present in the…
- A part named 'PART_LogTextBox' must be present in the…
- A part named 'PART_LogGridView' must be present in the…
AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14).
Data as JSON: /api/errors/278d2839814c3a13.
Report an issue: GitHub.
Appendix: source
Thrown at sources/presentation/Stride.Core.Presentation.Wpf/Controls/FilteringComboBox.cs:240
}
}
private static void OnIsFilteringChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var filteringComboBox = (FilteringComboBox)d;
if (filteringComboBox.ItemsSource != null)
{
filteringComboBox.UpdateCollectionView();
}
}
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
editableTextBox = GetTemplateChild("PART_EditableTextBox") as TextBox;
if (editableTextBox == null)
throw new InvalidOperationException("A part named 'PART_EditableTextBox' must be present in the ControlTemplate, and must be of type 'Stride.Core.Presentation.Controls.Input.TextBox'.");
listBox = GetTemplateChild("PART_ListBox") as ListBox;
if (listBox == null)
throw new InvalidOperationException("A part named 'PART_ListBox' must be present in the ControlTemplate, and must be of type 'ListBox'.");
editableTextBox.TextChanged += EditableTextBoxTextChanged;
editableTextBox.PreviewKeyDown += EditableTextBoxPreviewKeyDown;
editableTextBox.Validating += EditableTextBoxValidating;
editableTextBox.Validated += EditableTextBoxValidated;
editableTextBox.Cancelled += EditableTextBoxCancelled;
editableTextBox.LostFocus += EditableTextBoxLostFocus;
listBox.MouseUp += ListBoxMouseUp;
}
protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
{
base.OnGotKeyboardFocus(e);
if (OpenDropDownOnFocus && !listBoxClicking)View on GitHub (pinned to 96fad776d2)