This is a migrated thread and some comments may be shown as answers.

[Solved] Margin between checkbox and image

2 Answers 414 Views
CheckedListBox
This is a migrated thread and some comments may be shown as answers.
Marco
Top achievements
Rank 2
Veteran
Marco asked on 11 Mar 2021, 04:54 PM

Hello Telerik,

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

Sort by
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;
private void RadCheckedListBox1_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/.

Jane
Top achievements
Rank 1
commented on 02 Feb 2026, 07:01 AM

What about to give less space between each checkbox vertically?
Nadya | Tech Support Engineer
Telerik team
commented on 02 Feb 2026, 12:11 PM

Hello, Jane,

If you need to manage the space between each checkbox vertically you can use the ItemSpacing property. This property controls the spacing between items, respectively the checkboxes. Its default value is 0. 

Regards,
Nadya

0
Marco
Top achievements
Rank 2
Veteran
answered on 12 Mar 2021, 05:03 PM

It's work perfectly !

Thank you very much

Tags
CheckedListBox
Asked by
Marco
Top achievements
Rank 2
Veteran
Answers by
Nadya | Tech Support Engineer
Telerik team
Marco
Top achievements
Rank 2
Veteran
Share this question
or