I have a custom visual item class derived from RadListVisualItem. My custom visual item is being created in the CreatingVisualListItem event, but the "Padding" property is ignored. I've tried Margin, as well, but no luck. My class is below. What am I missing?
public class CustomVisualItem : RadListVisualItem
{
DockLayoutPanel mainContainer;
StackLayoutElement leftColumn;
StackLayoutElement rightColumn;
LightVisualElement titleElement;
LightVisualElement photoElement;
private ImagePrimitive image;
public ImagePrimitive Image
{
get
{
return this.image;
}
}
protected override Type ThemeEffectiveType
{
get
{
return typeof(RadListVisualItem);
}
}
protected override void CreateChildElements()
{
base.CreateChildElements();
mainContainer = new DockLayoutPanel();
leftColumn = new StackLayoutElement();
rightColumn = new StackLayoutElement();
photoElement = new LightVisualElement();
titleElement = new LightVisualElement();
this.Children.Add(mainContainer);
mainContainer.LastChildFill = true;
leftColumn.Orientation = Orientation.Vertical;
leftColumn.Children.Add(photoElement);
photoElement.DrawBorder = true;
photoElement.Shape = new CircleShape();
photoElement.BackColor = Color.Transparent;
photoElement.BackColor2 = Color.Transparent;
photoElement.BackColor3 = Color.Transparent;
photoElement.BackColor4 = Color.Transparent;
photoElement.AutoSize = false;
rightColumn.Orientation = Orientation.Vertical;
rightColumn.Children.Add(titleElement);
titleElement.Padding = new Padding(50);
titleElement.AutoSize = false;
titleElement.DrawBorder = true;
titleElement.BorderBoxStyle = Telerik.WinControls.BorderBoxStyle.FourBorders;
titleElement.BorderLeftWidth = 0;
titleElement.BorderTopWidth = 1;
titleElement.BorderRightWidth = 0;
titleElement.BorderBottomWidth = 0;
mainContainer.Children.Add(leftColumn);
mainContainer.Children.Add(rightColumn);
DockLayoutPanel.SetDock(leftColumn, Telerik.WinControls.Layouts.Dock.Left);
DockLayoutPanel.SetDock(rightColumn, Telerik.WinControls.Layouts.Dock.Right);
leftColumn.NotifyParentOnMouseInput = true;
rightColumn.NotifyParentOnMouseInput = true;
titleElement.NotifyParentOnMouseInput = true;
photoElement.NotifyParentOnMouseInput = true;
}
}