We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Sizing XPTaskBoxes inside an XPTaskBar?

Hi, I'm dynamically adding labels to a panel inside a XPTaskBox, and I would like to set the width of the task box to show the entire length of the label. I've been doing this by setting the XPTaskBar to the required width, but keeping the panel the task bar exists on at the desired width, causing scroll bars to pop up when required. However, I'm experiencing some problems with the sizing / positioning of the task bar/boxes. (I feel it may be imporant to note that I have a 10 pixel docking padding). Sometimes (seems to occur most often when there are only two items in the item, or there are sufficient items in the list that a vertical scrollbar would be required), the XPTaskBar sizes too small (smaller than the width I've set), when I click on one of the collapse buttons on the task boxes (or do a resize), the task boxes suddenly jump to the correct size. I haven't been able to create an sample example that consistantly displays this problems, so I can't really provide any code, but would appreciate any suggestions that could be made. Also, is there any preferred event for me to catch so I can resize the height of my panel when the XPTaskBoxes collapse or expand? Thanks, Sue

9 Replies

RP Ramesh Praveen Syncfusion Team August 14, 2003 06:33 PM UTC

Sue, How do you change the width of the xptaskbar? Via the Size property? Is the xptaskbar also set to Dock/Anchor, etc with the parent Panel? The XPTaskBarbox has a AfterAnimation event that will be called after expand/collapse. Regards, Praveen


SH Sue Harris September 18, 2003 10:14 PM UTC

I've finally managed to reproduce this problem in a sample. It seems to be related to AutoSize (which keeps setting itself to true for the XPTaskBarBox), and scrollbars (which I'm handling myself). If you run the sample, and scroll over you can see that the taskbarbox isn't initially sizing all the way to the right as it should, but as soon as you minimize one of the task bars, it corrects itself. Can you help me solve this? Thanks, Sue


AD Administrator Syncfusion Team September 19, 2003 04:50 PM UTC

Hi Sue, Thanks for the sample. We could see the problem that you are facing. You could overcome this problem by handling the SizeChanged event of the xpTaskBar1 in the TaskBarBoxPanels.cs file as follows: private void xpTaskBar1_SizeChanged(object sender, System.EventArgs e) { /* The normal layout performed for the boxes in the XPTaskBar's Layout event is not good enough in this case, so work around it by forcing a layout here.*/ this.xpTaskBar1.PerformLayout(); } Please let me know if this helps. Regards, Guru Patwal.


SH Sue Harris September 21, 2003 06:54 PM UTC

Hi Guru, Your sample code fixed the problem with the size being incorrect, the only other (small) problem, is the first time I collapse one of the boxes, the autoscrollposition of my panel is jumping back to the start, which it doesn't do in subsequent collapse/expand operations. Thanks, Sue


AD Administrator Syncfusion Team September 22, 2003 07:02 PM UTC

Hi Sue, Please let me know the steps to reproduce this behavior in the sample you have sent or in our demo sample so that we can investigate it further. Thanks for your cooperation. Regards, Guru Patwal.


SH Sue Harris September 24, 2003 08:20 PM UTC

Hi Guru, If you take my original sample file, (you don't need to add the change you suggested), scroll right until the expand/collapse buttons on the task bar boxes are in view, and collapse one of the boxes, the scroll position jumps back to the left. If you then scroll back to the right, you can expand and collapse the boxes, without affecting the scroll position. Regards, Sue


AD Administrator Syncfusion Team September 24, 2003 11:05 PM UTC

Hi Sue, I have tested for this issue using your sample in our latest release Essential Suite 1.6.1.6. The scrollbar jumped to the left everytime (not just the first time) I expanded/collapsed a XPTaskBarBox. Please let me know if you are experiencing problems due to this behavior of the scollbar. Also, if you are using an earlier version of Essential Suite, please open an incident in DirectTrac and place a request for the latest version. We will send you the download information for the latest release of Essential Suite. Thanks for your cooperation. Regards, Guru Patwal Syncfusion Inc.


SH Sue Harris September 25, 2003 03:30 AM UTC

Hi Guru, Strangely, I'm also using 1.6.1.6, but the scrollbar only jumps left the first time I collapse a task bar box (for each box). It's not a huge issue, just vaguely annoying that it isn't consistant. Thanks for your assistance. Regards, Sue


AD Administrator Syncfusion Team September 25, 2003 11:31 AM UTC

Hi Sue, After having further investigated this issue, I could observe that the scrollbar jumps to the left only when a new XPTaskBarBox gains focus. In other words, for the first time when you scroll to the right and collapse a XPTaskBarBox, the scrollbar jumps back to the left. Now when you scroll back to the right and expand/collapse the same XPTaskBarBox the scrollbar stays put. But if you collapse/expand some other XPTaskBarBox scrollbar will jump to the left again. After having consulted the Essential Suite development team on this issue, I would like to inform you that this is a natural behavior of the .NET wherein it makes sure that the control's leftmost portion is visible whenever it gains focus. Hope this helps. Regards, Guru Patwal Syncfusion Inc.

Loader.
Up arrow icon