Hi everybody !
I Have this xml that load the radLayout Control?
<RadLayoutControl TabIndex="0">
<Items>
<Telerik.WinControls.UI.LayoutControlSeparatorItem Bounds="0, 0, 910, 4" Name="layoutControlSeparatorItem3" />
<Telerik.WinControls.UI.LayoutControlItem AssociatedControlName="" DrawText="False" Text="" Bounds="0, 376, 455, 251" />
<Telerik.WinControls.UI.LayoutControlItem AssociatedControlName="" DrawText="False" Text="" Bounds="455, 376, 455, 251" />
<Telerik.WinControls.UI.LayoutControlItem AssociatedControlName="" DrawText="False" Text="" Bounds="0, 198, 455, 178" />
<Telerik.WinControls.UI.LayoutControlItem AssociatedControlName="" DrawText="False" Text="" Bounds="455, 198, 455, 178" />
<Telerik.WinControls.UI.LayoutControlItem AssociatedControlName="" DrawText="False" Text="" Bounds="0, 4, 455, 194" />
<Telerik.WinControls.UI.LayoutControlItem AssociatedControlName="" DrawText="False" Text="" Bounds="455, 4, 455, 194" />
</Items>
</RadLayoutControl>
When load the layout from "this.radLayoutControl2.LoadLayout(pathTheXml);" My ideia is set in each LayoutControlItem the Chart. I try this:
var itens = this.radLayoutControl2.Items.OfType<LayoutControlItem>().ToList();
var layoutSeparator = this.radLayoutControl2.Items.OfType<LayoutControlSeparatorItem>().FirstOrDefault();
foreach (var newTeamMemberItem in itens)
{
RadChartView radChartView = new RadChartView();
radChartView.Title = "AAAAAA";
radChartView.Name = "radChartView" + index;
radChartView.ThemeName = this.radLayoutControl1.ThemeName;
setChart(chartModelArea, radChartView, EnumTipoGrafico.Barra);
newTeamMemberItem.Name = "nameStart";
newTeamMemberItem.AssociatedControl = radChartView;
newTeamMemberItem.DrawText = true;
newTeamMemberItem.MaxSize = newTeamMemberItem.MaxSize;
newTeamMemberItem.MinSize = newTeamMemberItem.MinSize;
newTeamMemberItem.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
newTeamMemberItem.TextFixedSize = 26;
newTeamMemberItem.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
newTeamMemberItem.TextPosition = Telerik.WinControls.UI.LayoutItemTextPosition.Top;
newTeamMemberItem.TextSizeMode = Telerik.WinControls.UI.LayoutItemTextSizeMode.Fixed;
if (layoutSeparator != null)
this.radLayoutControl2.AddItem(newTeamMemberItem, layoutSeparator, LayoutControlDropPosition.Bottom);
else
this.radLayoutControl2.AddItem(newTeamMemberItem, newTeamMemberItem, LayoutControlDropPosition.Bottom);
}
But this doesn't work. Can you help please. Thanks