Hi !
I'm using a customized listviewitem and i've got this problem, after 2 days on a listviewitem ! :
see attach.
my vertical StackLayoutElement not take availble size.
i want only this part take availble and resize when resize my form
private class interlocuteurVisualItem : SimpleListViewVisualItem
{
private LightVisualElement entite;
private LightVisualElement localisation_Add;
private LightVisualElement localisation_Com;
private LightVisualElement typeInterlocuteur;
protected override void CreateChildElements()
{
this.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.FitToAvailableSize;
StackLayoutElement layoutPanel = new StackLayoutElement();
layoutPanel.Orientation = Orientation.Horizontal;
layoutPanel.MinSize = new Size(layoutPanel.MinSize.Width, 100);
//Entite
this.entite = new LightVisualElement();
this.entite.TextWrap = true;
this.entite.MinSize = new Size(200, 80);
this.entite.Size = new Size(200, 80);
this.entite.DrawBorder = true;
this.entite.StretchHorizontally = false;
this.entite.Alignment = ContentAlignment.MiddleLeft;
this.entite.TextAlignment = ContentAlignment.MiddleLeft;
layoutPanel.Children.Add(entite);
//Localisation
StackLayoutElement layoutPanel_Localisation = new StackLayoutElement();
layoutPanel_Localisation.Orientation = Orientation.Vertical;
layoutPanel_Localisation.AutoSize = true;
layoutPanel_Localisation.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.FitToAvailableSize;
layoutPanel_Localisation.Alignment = ContentAlignment.MiddleLeft;
layoutPanel_Localisation.StretchHorizontally = true;
layoutPanel_Localisation.StretchVertically = true;
//Localisation adresse
this.localisation_Add = new LightVisualElement();
this.localisation_Add.Alignment = ContentAlignment.BottomLeft;
this.localisation_Add.TextAlignment = ContentAlignment.MiddleLeft;
this.localisation_Add.DrawBorder = true;
this.localisation_Add.TextWrap = true;
this.localisation_Add.StretchHorizontally = true;
layoutPanel_Localisation.Children.Add(localisation_Add);
//Localisation CP & Commune
this.localisation_Com = new LightVisualElement();
this.localisation_Com.Alignment = ContentAlignment.BottomLeft;
this.localisation_Com.TextAlignment = ContentAlignment.MiddleLeft;
this.localisation_Com.TextWrap = true;
this.localisation_Com.DrawBorder = true;
this.localisation_Com.StretchHorizontally = true;
layoutPanel_Localisation.Children.Add(localisation_Com);
layoutPanel.Children.Add(layoutPanel_Localisation);
// typeInterlocuteur
this.typeInterlocuteur = new LightVisualElement();
this.typeInterlocuteur.MinSize = new Size(200, 80);
this.typeInterlocuteur.Size = new Size(200, 80);
this.typeInterlocuteur.StretchHorizontally = false;
this.typeInterlocuteur.TextWrap = true;
this.typeInterlocuteur.TextAlignment = ContentAlignment.MiddleLeft;
this.typeInterlocuteur.DrawBorder = true;
layoutPanel.Children.Add(typeInterlocuteur);
this.Children.Add(layoutPanel);
base.CreateChildElements();
}
protected override void SynchronizeProperties()
{
base.SynchronizeProperties();
Text = "";
entite.Text = Convert.ToString(Data["NomEntite"]);
localisation_Add.Text = $"{Data["Adresse"]}";
localisation_Com.Text = $"{Data["CodePostal"]} {Data["Commune"]}";
typeInterlocuteur.Text = Convert.ToString(Data["TypeInterlocuteur"]);
}
protected override Type ThemeEffectiveType
{
get
{
return typeof(SimpleListViewVisualItem);
}
}
}