This is a migrated thread and some comments may be shown as answers.

Customize Dialog layout is corrupted in Japanese environment

6 Answers 54 Views
CommandBar
This is a migrated thread and some comments may be shown as answers.
Mitsuru
Top achievements
Rank 1
Mitsuru asked on 05 Jul 2011, 03:23 PM
Hello,

I think because of in a Japanese environment, CommandBar Customize Dialog layout is corrupted as the attached file.
I use 64bit Windows 7 Japanese Version.
Is there any way to correct this?

Thank you.

6 Answers, 1 is accepted

Sort by
0
Accepted
Ivan Todorov
Telerik team
answered on 08 Jul 2011, 01:15 PM
Hi Mitsuru,

Thank you for posting.

We have encountered such issues before and we are still investigating them. Meanwhile, you can try inheriting from the default customize dialog and replacing it in the RadCommandBar by using the mechanism provided by the CommandBarCustomizeDialogProvider class. I am posting a sample code here:

The inherited dialog provider :
public class MyCommandBarDialogProvider : CommandBarCustomizeDialogProvider
    {
        public override Form ShowCustomizeDialog(object sender, CommandBarStripInfoHolder infoHolder)
        {
            CommandBarCustomizeDialog dialog = new MyCommandBarDialog(infoHolder);
            RadElement senderElement = sender as RadElement;
            RadControl senderControl = sender as RadControl;
             
            if (senderControl == null && senderElement != null && senderElement.ElementTree != null)
            {
                senderControl = senderElement.ElementTree.Control as RadControl;
            }
 
            if (sender is CommandBarStripElement)
            {
                dialog.stripsListControl.SelectedValue = sender;
                dialog.radPageView.SelectedPage = dialog.toolstripItemsPage;
            }
            else if (sender is RadCommandBar)
            {
                dialog.radPageView.SelectedPage = dialog.toolstripsPage;
            }
 
            if (senderControl != null)
            {
                dialog.ThemeName = senderControl.ThemeName;
                dialog.RightToLeft = senderControl.RightToLeft;
            }
            else if (senderElement != null)
            {
                dialog.RightToLeft = senderElement.RightToLeft ? RightToLeft.Yes : RightToLeft.No;
            }
 
            if (OnDialogOpening(dialog))
            {
                return null;
            }
 
            OnDialogOpened(dialog);
            dialog.ShowDialog();
 
            return dialog;
        }
    }

The inherited dialog:
public class MyCommandBarDialog : CommandBarCustomizeDialog
{
    public MyCommandBarDialog(CommandBarStripInfoHolder holder)
        : base(holder)
    {
        InitializeComponent();
    }
 
    private void InitializeComponent()
    {
        ((System.ComponentModel.ISupportInitialize)(this.radPageView)).BeginInit();
        this.radPageView.SuspendLayout();
        this.toolstripsPage.SuspendLayout();
        this.toolstripItemsPage.SuspendLayout();
        ((System.ComponentModel.ISupportInitialize)(this.stripsListControl)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.closeButton)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.stripsDropDownList)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.stripItemsListControl)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.moveUpButton)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.moveDownButton)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.chooseToolstripLabel)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.resetItemsButton)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
        this.SuspendLayout();
        //
        // radPageView
        //
        //
        //
        //
        this.radPageView.RootElement.Padding = new System.Windows.Forms.Padding(3, 3, 3, 26);
        this.radPageView.Size = new System.Drawing.Size(392, 458);
        //
        // toolstripsPage
        //
        this.toolstripsPage.Size = new System.Drawing.Size(376, 392);
        //
        // toolstripItemsPage
        //
        this.toolstripItemsPage.Size = new System.Drawing.Size(376, 392);
        //
        // stripsListControl
        //
        this.stripsListControl.Size = new System.Drawing.Size(370, 386);
        //
        // closeButton
        //
        this.closeButton.Location = new System.Drawing.Point(133, 434);
        this.closeButton.Size = new System.Drawing.Size(109, 24);
        //
        // stripItemsListControl
        //
        this.stripItemsListControl.Size = new System.Drawing.Size(269, 334);
        //
        // chooseToolstripLabel
        //
        this.chooseToolstripLabel.TextWrap = true;
        //
        // MyCommandBarDialog
        //
        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
        this.ClientSize = new System.Drawing.Size(392, 458);
        this.Name = "MyCommandBarDialog";
        //
        //
        //
        this.RootElement.ApplyShapeToControl = true;
        ((System.ComponentModel.ISupportInitialize)(this.radPageView)).EndInit();
        this.radPageView.ResumeLayout(false);
        this.toolstripsPage.ResumeLayout(false);
        this.toolstripItemsPage.ResumeLayout(false);
        this.toolstripItemsPage.PerformLayout();
        ((System.ComponentModel.ISupportInitialize)(this.stripsListControl)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.closeButton)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.stripsDropDownList)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.stripItemsListControl)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.moveUpButton)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.moveDownButton)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.chooseToolstripLabel)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.resetItemsButton)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this)).EndInit();
        this.ResumeLayout(false);
 
    }
}

In order to put the above classes in action, use the following code:
CommandBarCustomizeDialogProvider.CurrentProvider = new MyCommandBarDialogProvider();

Hope this will help you. Do not hesitate to write back if you have any further questions.

Best wishes,
Ivan Todorov
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Mitsuru
Top achievements
Rank 1
answered on 08 Jul 2011, 07:37 PM
It works fine now.
Thank you for your kind support!
0
Andreas Lohr
Top achievements
Rank 1
answered on 20 Jul 2011, 10:31 AM
Hi,

I have a similar problem with Japanese computers I think.
But in my case the problem is the Grid. It is moved down and for that reason 2 buttons are not visible.
Has anyone a solution for that?
Would the buttons be visible (laying over instead of under the grid), if the Tabindex of the buttons is higher then the tabindex of the grid?

Best regards
Andreas
0
Ivan Todorov
Telerik team
answered on 22 Jul 2011, 03:11 PM
Hi Andreas,

The TabIndex property stands for defining the order in which the controls are being focused when using the Tab key. In your case, you can try calling the BringToFront() method of these buttons or use the 'Bring to Front' menu item from the context menu of the Visual Studio's designer.

Hope this helps. Do not hesitate to ask if you have any additional questions.

Greetings,
Ivan Todorov
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Andreas Lohr
Top achievements
Rank 1
answered on 25 Jul 2011, 10:59 PM
hi Ivan,

thanks for the explanation, I will try that.
But the problem only exists because the grid is "moved" down. It seems, that on Japanese computers the grid is moved down. That is the reason that the buttons are not visible. Usually they are visible, because the grid is placed higher.

Any tipps / ideas why that happens on Japanese computers or how I can resolve that?

Regards, Andreas
0
Ivan Todorov
Telerik team
answered on 28 Jul 2011, 12:34 PM
Hi Andreas,

We still have no general solution for this case. However, you can try disabling the auto-scale functionality in your forms. Since the text is in English and the DPI settings are the default ones, you do not need this feature. You can try commenting the following lines in your Form.Designer.cs file:
Copy Code
//this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
//this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;

I hope this will help you. If you have further questions, do not hesitate to ask.

Regards,
Ivan Todorov
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
CommandBar
Asked by
Mitsuru
Top achievements
Rank 1
Answers by
Ivan Todorov
Telerik team
Mitsuru
Top achievements
Rank 1
Andreas Lohr
Top achievements
Rank 1
Share this question
or