Skip to main content
A newer version of this page is available. .

How to: Localize a Grid by Replacing Specific Strings at Runtime

This example shows how to change default strings displayed within the Group Panel and the Column Chooser's caption, at runtime.

<Window x:Class="WpfApplication24.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525" xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid">
    <Grid>
        <dxg:GridControl AutoPopulateColumns="True" Name="gridControl1">
            <dxg:GridControl.View>
                <dxg:TableView Name="tableView1" ShowTotalSummary="True">
                    <dxg:TableView.RuntimeLocalizationStrings>
                        <dxg:GridRuntimeStringCollection>
                            <dxg:RuntimeStringIdInfo Id="GridGroupPanelText" Value="Group Panel"/>
                            <dxg:RuntimeStringIdInfo Id="ColumnChooserCaption" Value="Hidden Columns"/>
                        </dxg:GridRuntimeStringCollection>
                    </dxg:TableView.RuntimeLocalizationStrings>
                </dxg:TableView>
            </dxg:GridControl.View>
        </dxg:GridControl>
    </Grid>
</Window>