Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I've wrapped a WebChartControl from DevExpress to expose it as a SharePoint WebPart, which I was successfully adding to a WebPart page with a fixed height/width.

I now want to automatically size this chart, to fit the size of the WebPart, or the zone that the WebPart is contained within, or up in the control tree until I find a defined size that I can use.

At the moment my WebPart has no size (auto-sizes to the zone), and the zone doesn't have a specific size either, but the <td> that the zone is in does have a size, although as a percentage (I need it in pixels for DevExpress).

<td width="50%">
   <WebPartPages:WebPartZone runat="server" Title="loc:Row1Cell3b" 
       ID="Row1Cell3b" FrameType="TitleBarOnly">
    <ZoneTemplate></ZoneTemplate>
   </WebPartPages:WebPartZone>   
</td>

How should I go about obtaining the correct size, in pixels for my WebPartControl in code?

Thanks for your help.

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.