Hello Support-Team,
I'm using a RadScheduler with a custom ElementProvider. I need some Help with the Elements. I wanted the name element on top and a info box right below using the rest of the free space. I made a screenshot and here is my code for the CustomElements:
class CustomSchedulerResourceHeaderCellElement : SchedulerResourceHeaderCellElement
{
private readonly StackLayoutElement _container = new StackLayoutElement();
private readonly StackLayoutElement _subContainer = new StackLayoutElement();
private readonly LightVisualElement _nameElement = new LightVisualElement();
private readonly LightVisualElement _infoElement = new LightVisualElement();
protected override void CreateChildElements()
{
base.CreateChildElements();
_container.StretchHorizontally = true;
_container.StretchVertically = true;
_container.Orientation = Orientation.Vertical;
_container.Alignment = ContentAlignment.TopCenter;
_container.Padding = new Padding(3);
_container.Children.Add(_nameElement);
_nameElement.StretchHorizontally = true;
_nameElement.DrawImage = true;
_nameElement.ImageLayout = ImageLayout.None;
_nameElement.TextWrap = true;
_nameElement.TextAlignment = ContentAlignment.TopLeft;
_nameElement.ImageAlignment = ContentAlignment.TopLeft;
_nameElement.TextImageRelation = TextImageRelation.ImageBeforeText;
_container.Children.Add(_subContainer);
_subContainer.StretchHorizontally = true;
_subContainer.StretchVertically = true;
_subContainer.Orientation = Orientation.Vertical;
_subContainer.Alignment = ContentAlignment.TopCenter;
_subContainer.Children.Add(_infoElement);
_infoElement.StretchHorizontally = true;
_infoElement.StretchVertically = true;
_infoElement.TextWrap = true;
_infoElement.TextAlignment = ContentAlignment.TopLeft;
_infoElement.BackColor = Color.FromArgb(128, Color.LightGray);
_infoElement.NumberOfColors = 1;
_infoElement.DrawFill = true;
_infoElement.Font = new Font(this.Font, FontStyle.Regular);
this.Children.Add(_container);
this.DrawImage = false;
this.DrawText = false;
}
public override string Text
{
get
{
InitElements();
return base.Text;
}
set
{
base.Text = value;
}
}
/* Some more methods for setting the text elements and the image*/
}
I started with only one container, but adding a subcontainer didn't do the trick. Hope you can provide me a solution.
Regards,
Stephan