Skip to main content

DataViewBase.RuntimeLocalizationStrings Property

Gets or sets the collection of resource strings that can be localized at runtime. This is a dependency property.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v24.2.Core.dll

NuGet Package: DevExpress.Wpf.Grid.Core

Declaration

public GridRuntimeStringCollection RuntimeLocalizationStrings { get; set; }

Property Value

Type Description
DevExpress.Xpf.Grid.GridRuntimeStringCollection

A DevExpress.Xpf.Grid.GridRuntimeStringCollection object that contains resource strings that can be localized at runtime.

Remarks

Individual default strings displayed within the grid (e.g. group panel text, the column chooser’s caption, etc.) can be changed at runtime. To translate individual resource strings at runtime, create a DevExpress.Xpf.Grid.RuntimeStringIdInfo object with the specified Id and Value properties, and add it to the View’s RuntimeLocalizationStrings collection. The Id property identifies the required resource string. The Value property specifies a new value for it.

Example

This example shows how to change the default string displayed in the Group Panel at runtime.

WPF Grid - Runtime Localization

View Example: Localize Individual Strings at Runtime

<dxg:GridControl x:Name="grid" AutoGenerateColumns="AddNew">
    <dxg:GridControl.View>
        <dxg:TableView x:Name="view" AutoWidth="True"/>
    </dxg:GridControl.View>
</dxg:GridControl>
<StackPanel Grid.Row="1" Orientation="Horizontal">
    <TextBox x:Name="textBox" Width="200" KeyDown="textBox_KeyDown" Margin="3,3,3,3"/>
    <Button Content="Apply" Click="button_Click" Margin="0,3,0,3"/>
</StackPanel>
void LocalizeGroupPanelText() {
    var NewText = textBox.Text;
    var localization = new GridRuntimeStringCollection();
    localization.Add(new RuntimeStringIdInfo(GridControlRuntimeStringId.GridGroupPanelText, NewText));
    view.RuntimeLocalizationStrings = localization;
}
void button_Click(object sender, RoutedEventArgs e) {
    LocalizeGroupPanelText();
}

void textBox_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) {
    if (e.Key == System.Windows.Input.Key.Enter) {
        LocalizeGroupPanelText();
    }
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the RuntimeLocalizationStrings property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also