Page 1 of 1

GetActualSize is returning 0 height and width

Posted: Thu Mar 27, 2014 12:35 pm
by shyam.pundkar
Dear Stimulsoft Team

I am trying to get the actual size of stiText. I initialized the instance of stiText with the height and width of 0.8 and assigned a large text to TextValue then I executed below lines. But still I am getting 0 as width and height.

((StiText)cellComponent).CanGrow = true;
((StiText)cellComponent).CanShrink = true;
((StiText)cellComponent).AutoWidth = true;

var actualSize = ((StiText) cellComponent).GetActualSize();

Could you please help me in getting the actual size of stiText?

Thanks
SHYAM

Re: GetActualSize is returning 0 height and width

Posted: Thu Mar 27, 2014 1:17 pm
by HighAley
Hello.

Why do you need to get height of the text component?
Do you use pure Silverlight or Client/Server version?
Could you send us any sample report?

Thank you.

Re: GetActualSize is returning 0 height and width

Posted: Fri Mar 28, 2014 6:52 am
by shyam.pundkar
Dear Aleksey

I got the solution of my problem.
I am using client/server version.
The very first cell in a row of the report was getting wrapped because of the large text content. I wanted the other cells in the same row to follow the same height as the very first cell's height.
So I wanted to get the height of the first cell so that I can apply that to subsequent cells.
I got the actual height of the first cell by first calling Render and then calling GetActualSize. I wrote this piece of code at server side.

((StiText) cellComponent).Render().GetActualSize();

Thanks for acknowledging my question!

Best Regards
SHYAM

Re: GetActualSize is returning 0 height and width

Posted: Fri Mar 28, 2014 8:20 am
by HighAley
Hello.

Why don't you set the Grow to Height property.
Please, read the Binding The Bottom Border Of A Component article.

Thank you.

Re: GetActualSize is returning 0 height and width

Posted: Wed Apr 02, 2014 5:58 am
by shyam.pundkar
Dear Aleksey,

I replaced my code with the GrowToHeight = true and it worked!
So now I am using GrowToHeight property.

Thanks for your solution and the informative link.
Really Appreciated!

Best Regards
SHYAM

Re: GetActualSize is returning 0 height and width

Posted: Wed Apr 02, 2014 12:53 pm
by HighAley
Hello.

We are always glad to help you.
Let us know if you need any additional help.

Thank you.