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

Copy style not working for format

4 Answers 308 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Kevin
Top achievements
Rank 1
Kevin asked on 18 Jun 2012, 08:52 PM
I am confused.  I have a chart with 10 fields of numbers.  I select one field, go to format, and set the format to currency with zero decimal places.  Next I right click the field and select COPY STYLE.  Then I select the other 9 fields and select PASTE STYLE.  The format of the other 9 fields does not change.  I have tried selecting all the fields and then right clicking, but when I do that the format option is grayed out and unavailable.

I have had a similar experience where pasting the style from one field to another did not change the font size of the second field to match that of the first.  Doesn't COPY STYLE apply to all elements - size, font, color, bold,, etc?

I am not sure if I am doing something wrong, or if possibly something is corrupt in my Visual Studios installation.  It seems like this should work.

Thanks,
Kevin

4 Answers, 1 is accepted

Sort by
0
Elian
Telerik team
answered on 21 Jun 2012, 02:07 PM
Hello Kevin,

When using Copy/Paste style only the properties listed under Style will be copied. The Format property is not considered a style property and thus won't be copied along.
If you want to copy the same format - after you have formatted 1 field, simply select the format property from the property grid, copy it's text, then select all the other fields and paste it. 
As to the Copy/Paste style problem you are describing, most probably you have used predefined report template (from the Wizard) and if that is the case, then the elements themselves do not have style - there are global styles which are applied through the StyleName property (see Creating Style Rules). 
 
All the best,
Elian
the Telerik team

FREE WEBINAR ON THE NEW REPORT DESIGNER! Join us on Friday, June 29 at 10:00 AM for a comprehensive demo of the official version of the standalone Report Designer and find out how easy it is to empower your users with creating, editing and sharing ad-hoc reports. The webinar will go through a real-world scenario of creating reports, embedding them in your application(s), and distributing them within your organization. We will also cover the newly added support for sub-reports, navigation actions (such as drill-down and drill-through), and report sources. Register here and bring your questions with you. We’ll try to address them during the webinar! You may even win a Telerik Ultimate Collection license! Register today >>

0
Adrian
Top achievements
Rank 1
answered on 08 Aug 2012, 07:08 PM
Elian -

If that's the case, then you need to update your tutorials.  The "Extending Simple Report" tut causes friction at step 3 when things don't work as described.

http://www.telerik.com/help/reporting/quick-start-class-lib-extending.html 

Nice tool so far btw. Great work! 
0
Jaco Hamilton-Attwell
Top achievements
Rank 1
answered on 15 Aug 2012, 05:50 PM
Hi Kevin

I was struggling with the non-copying style as explained in the "Extending..." document a few minutes ago. Thanks to your question and Elain's answer I was able to determine that, copying the StyleName value and pasting that value in the same property of my un-styled control does all the magic.

Elain, as Adrian mentioned, please ask the author(s) to update the in the documentation.

Regards
0
Steve
Telerik team
answered on 20 Aug 2012, 04:14 PM
Hi guys,

As you can see from the Style Class and its properties, only inline styles are handled via the copy/paste operation. Any global/external style/style name would not be copied via the copy/paste operation and as you have found out, for this purpose you can use the StyleName property.

The part about styling in the help article in question is now outdated as the Report Wizard applies styles via global styles using StyleName now. In older versions of the product, the styling from the Report Wizard was via inline styles - thus the discrepancy you have found, for which we apologize. The help article would be updated accordingly.


@Adrian: thank you for the kind words - much appreciated!

Kind regards,
Steve
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

Tags
General Discussions
Asked by
Kevin
Top achievements
Rank 1
Answers by
Elian
Telerik team
Adrian
Top achievements
Rank 1
Jaco Hamilton-Attwell
Top achievements
Rank 1
Steve
Telerik team
Share this question
or