Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
570
How to change the header in girds ColumnChooserControl ?
posted

Hi all !

I'm using the UltraGrids built-in ui ColumnChooserControl.

Now, how can I change the controls header "Field Chooser" ?

My UltraGrid code looks like this: 

        private void DefaultInitializeLayout(InitializeLayoutEventArgs e){           
            e.Layout.Override.RowSelectors = DefaultableBoolean.True;
            e.Layout.Override.RowSelectorHeaderStyle = RowSelectorHeaderStyle.ColumnChooserButton; 
        }

        private void DefaultBeforeColumnChooserDisplayed(BeforeColumnChooserDisplayedEventArgs e) {
            e.Dialog.Size = new Size(250, 250);
            e.Dialog.DisposeOnClose = DefaultableBoolean.False;
            e.Dialog.ColumnChooserControl.MultipleBandSupport = MultipleBandSupport.SingleBandOnly;
            e.Dialog.ColumnChooserControl.Style = ColumnChooserStyle.AllColumnsWithCheckBoxes;
            e.Dialog.ColumnChooserControl.SyncLookWithSourceGrid = false;
            e.Dialog.ColumnChooserControl.DisplayLayout.GroupByBox.Prompt = "Zeilen ein-/ausschalten";
        }

 Trying to change the controls header via

       e.Dialog.ColumnChooserControl.DisplayLayout.GroupByBox.Prompt= "Some string";

 doesn't work.

Any hint or idea is very welcome !

Thanks in advance,

Claus 

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi Claus,  

        The text you are referring to has nothing to do with the GroupByBox, it's the text of the dialog.  


            private void ultraGrid1_BeforeColumnChooserDisplayed(object sender, BeforeColumnChooserDisplayedEventArgs e)
            {
                e.Dialog.Text = "Some string";
            }

        But if you are trying to localize the strings in your application, you are better off using the ResourceCustomizer. For example, you could do this in Form_Load and it will affect all of the grids in your application. 

        Infragistics.Win.UltraWinGrid.Resources.Customizer.SetCustomizedString("ColumnChooserDialogCaption", "Some String"); 

         

Children
No Data