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

Scaling CommandBarHostItem

4 Answers 114 Views
CommandBar
This is a migrated thread and some comments may be shown as answers.
Johann
Top achievements
Rank 1
Johann asked on 24 Oct 2018, 01:52 PM

Good day, I'm struggling to get RadControls within CommandBarHostItems to scale at size 125%.
I've worked through your articles, applied the application manifest and set the relevant property on my main form.

Every other control is scaling as it should, but I can't get a RadCheckbox and RadMulticolumnComboBox to work?

See code below on how I set these controls:

RadCheckBox chkAutoFilter = new RadCheckBox();
chkHostAutoFilter.MinSize = new System.Drawing.Size(80, 20);
chkHostAutoFilter.HostedControl = chkAutoFilter;

RadMultiColumnComboBox cboCustomerID = new RadMultiColumnComboBox();
cboCustomerID.Name = "cboCustomerID";
cmbHostCustomerID.MinSize = new System.Drawing.Size(90, 20);
cmbHostCustomerID.HostedControl = cboCustomerID;

Telerik Version:  2018.1.116.40

Please advise.

4 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 25 Oct 2018, 08:30 AM
Hello Johann,

I have tested this and it works on my side (see attached). If I understand correctly the other controls are scaled and only the host items are not. Is that correct? Are you using a standard form or RadForm?

I am looking forward to your reply.
 
Regards,
Dimitar
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Johann
Top achievements
Rank 1
answered on 25 Oct 2018, 08:45 AM
My apologies, I should have mentioned I use a standard Winform(AutoScaleMode=Dpi), using RadForm is not really an option at the moment.
Would you mind confirming that you get the same behavior I do on a standard form?  If not I must be doing something wrong.
0
Dimitar
Telerik team
answered on 25 Oct 2018, 09:13 AM
Hi Johann,

Since with our implementation, the form is handling the controls scaling some controls may not be scaled properly with the standard form. Especially when they are added at runtime (this will work if you add the controls at design time).

Another approach is to manually scale them:
Screen showScreen = Screen.FromControl(this);
SizeF scale = NativeMethods.GetMonitorDpi(showScreen, NativeMethods.DpiType.Effective);
chkAutoFilter.Scale(scale);

Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik
Get quickly onboard and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Johann
Top achievements
Rank 1
answered on 25 Oct 2018, 10:10 AM
Thank you very much for your prompt assistance Dimitar.
I implemented the code you provided and everything is working as it should.
Tags
CommandBar
Asked by
Johann
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Johann
Top achievements
Rank 1
Share this question
or