How could I play with margin and padding to add some spacing between image, texte and certainly my checkboxe ?
Thank you in advance for your support !
2 Answers, 1 is accepted
0
Accepted
Nadya | Tech Support Engineer
Telerik team
answered on 12 Mar 2021, 03:43 PM
Hi, Marco,
You can use the VisualItemFormatting event to give more space between elements in SimpleListViewVisualItem. Please refer to the following code snippet:
this.radCheckedListBox1.VisualItemFormatting += this.RadCheckedListBox1_VisualItemFormatting;
privatevoidRadCheckedListBox1_VisualItemFormatting(object sender, ListViewVisualItemEventArgs e)
{
e.VisualItem.Image = Resources.bul;
//space between image and text
e.VisualItem.Layout.LeftPart.Margin = new Padding(0, 0, 15, 0);
//space between checkbox and image
((e.VisualItem as SimpleListViewVisualItem).Children[0] as ListViewItemCheckbox).Padding = new Padding(0, 0, 15, 0);
}
I hope this helps. Should you have other questions do not hesitate to contact me.
Regards,
Nadya
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.