This will allow the users to scroll through the tiles in all rows when the available height is insufficient.
WORKAROUND:
class CustomPanorama : RadPanorama
{
RadScrollBarElement vScroll;
protected override void CreateChildItems(Telerik.WinControls.RadElement parent)
{
base.CreateChildItems(parent);
this.vScroll = new RadScrollBarElement();
this.vScroll.ScrollType = ScrollType.Vertical;
this.vScroll.StretchHorizontally = false;
this.vScroll.StretchVertically = true;
this.vScroll.MinSize = new System.Drawing.Size(16, 0);
this.vScroll.Alignment = System.Drawing.ContentAlignment.TopRight;
this.PanoramaElement.Children.Add(vScroll);
this.vScroll.ValueChanged += new EventHandler(vScroll_ValueChanged);
this.PanoramaElement.GroupLayout.RadPropertyChanged += new Telerik.WinControls.RadPropertyChangedEventHandler(GroupLayout_RadPropertyChanged);
this.PanoramaElement.TileLayout.RadPropertyChanged += new Telerik.WinControls.RadPropertyChangedEventHandler(GroupLayout_RadPropertyChanged);
this.ScrollBarAlignment = HorizontalScrollAlignment.Bottom;
}
void GroupLayout_RadPropertyChanged(object sender, Telerik.WinControls.RadPropertyChangedEventArgs e)
{
if (e.Property == RadElement.BoundsProperty && sender == this.GetCurrentLayout())
{
UpdateVScroll();
}
}
protected override void OnSizeChanged(EventArgs e)
{
base.OnSizeChanged(e);
UpdateVScroll();
}
private void UpdateVScroll()
{
vScroll.Maximum = this.GetCurrentLayout().Size.Height;
vScroll.LargeChange = Math.Max(0, (int)(this.Size.Height - this.PanoramaElement.ScrollBar.Size.Height));
if (vScroll.LargeChange >= vScroll.Maximum)
{
vScroll.Visibility = ElementVisibility.Hidden;
}
else
{
vScroll.Visibility = ElementVisibility.Visible;
}
if (this.PanoramaElement.ScrollBar.Visibility == ElementVisibility.Visible)
{
vScroll.Margin = new System.Windows.Forms.Padding(0, 0, 0, this.PanoramaElement.ScrollBar.Size.Height);
}
else
{
vScroll.Margin = new System.Windows.Forms.Padding(0);
}
}
void vScroll_ValueChanged(object sender, EventArgs e)
{
this.GetCurrentLayout().PositionOffset = new System.Drawing.SizeF(0, -this.vScroll.Value);
}
private LayoutPanel GetCurrentLayout()
{
if (this.ShowGroups)
{
return this.PanoramaElement.GroupLayout;
}
return this.PanoramaElement.TileLayout;
}
public override string ThemeClassName
{
get
{
return typeof(RadPanorama).FullName;
}
set
{
base.ThemeClassName = value;
}
}
}
The user should be able to select tiles with the mouse or with the arrow keys.
Add a tile to a RadPanorama groups, and set its Image or BackgroundImage property with an animated gif image. Run the project and zoom out the view using the mouse wheel. The tile with the animated gif will disappear.
Enabling scrolling through the tiles at design time will let the developers select and edit in the designer tiles that are off-screen.
If you add 10 tiles in 2 columns of 5 tiles and run the project, you will see that the tiles are not correctly positioned. This happens only if AutoArrangeNewTiles is true.
IMPROVE. RadPanorama - the Items collection of the control should not accepts TileGroupElements
IMPROVE. RadPanorama - increase the RowsCount when the form's size is increased, so the user will be able to drag items there.
The position of a tile might get changed when the project is run and if the Row or Column properties of this tile have their default value of 0.
Steps to reproduce: 1. Add a RadPanorama to a form 2. Set the PanelImage to (none) 3. Run the project and you will see that the default image will be applied. At this time it seems that there is no way to prevent the default image from being applied. Until a decent solution is found (if any), this property is removed from the designer. COMMENT: This property should not be supported in design-time, because it is modified by each theme
Adding a tile with ColSpan property set to greater than 1 raises exception
Provide means of auto arranging tiles without setting the Column and Row property.