Customise Field Chooser TitleBar (FieldDialogBox)

Hi there,

How do I customise the text displayed in the FieldChooser TitleBar?
All my current FieldChooser code is below

<Code>
 FieldChooser ofieldChooser= new FieldChooser(gridInstruments);   //gridInstruments is of type GridGroupingControl
...
gridInstruments.ContextMenuStrip = ofieldChooser.ContextMenu;
</Code>



1 Reply

AR Arulpriya Ramalingam Syncfusion Team December 22, 2017 09:38 AM UTC

Hi James,   
   
Thanks for contacting Syncfusion support.   
   
The GridGroupingControl has the direct support to localize the strings in FieldChooser dialog by implementing the ILocalizationProvider interface and GetLocalizedString() method can be used to change the string/values for the fieldchooser dialog. In that method, the FieldChooser property of DynamicFilterResourceIdentifiers can be used to edit the FieldChooser value and the FieldDialogBox property can be used to edit the FieldDialogBox text. We have created a simple sample as per your requirement. Please make use of below code and sample,   
   
Code example    
   
class Localizer : ILocalizationProvider   
{   
    public string GetLocalizedString(System.Globalization.CultureInfo culture, string name,object obj)   
    {   
        switch (name)   
        {   
            //To localize the fieldChooser string   
            case DynamicFilterResourceIdentifiers.FieldChooser:   
                    return "Custom text for fieldChooser";   
            //To localize the FieldDialogBox   
            case DynamicFilterResourceIdentifiers.FieldDialogBox:   
                    return " Custom text for fieldDialogBox";   
            default:   
                return string.Empty;   
        }   
    }   
}   
   
Localizer localization = new Localizer();   
//To add the localized strings localization provider   
LocalizationProvider.Provider = localization;   
   
//To enable the field chooser to the grid   
FieldChooser fieldChooser = new FieldChooser(this.gridGroupingControl1);   
   
   
Regards,   
Arulpriya  


Loader.
Up arrow icon