the gap between checkboxes and their labels should be increase

1 Answer 127 Views
CheckedListBox
Naresh
Top achievements
Rank 1
Iron
Naresh asked on 02 Mar 2022, 08:02 AM

the gap between checkboxes and their labels should be increase

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 02 Mar 2022, 12:35 PM
Hello, Naresh,

RadCheckedListBox offers the VisualItemFormatting event which is appropriate for adjusting the space between the checkbox and the text. Please refer to the following code snippet:
        private void radCheckedListBox1_VisualItemFormatting(object sender, ListViewVisualItemEventArgs e)
        {
            SimpleListViewVisualItem visualItem = e.VisualItem as SimpleListViewVisualItem;
            if (visualItem!=null)
            {
                visualItem.ToggleElement.Margin = new Padding(0, 0, 40, 0);
            }
        }

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
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/.

Naresh
Top achievements
Rank 1
Iron
commented on 03 Mar 2022, 12:41 PM

I need increse gap between checkbox and text labed in  RadTreeview  control
Dess | Tech Support Engineer, Principal
Telerik team
commented on 03 Mar 2022, 02:56 PM

Hi, Naresh,

The specified Product for this forum thread is CheckedListBox / UI for WinForms. That is why the provided solution was relevant for RadCheckedListBox. As to the question about RadTreeView, it is possible to apply a similar margin to the toggle element inside the NodeFormatting event: 
        private void RadTreeView1_NodeFormatting(object sender, TreeNodeFormattingEventArgs e)
        {
            e.NodeElement.ToggleElement.Margin = new System.Windows.Forms.Padding(0,0,40,0);
        }

Tags
CheckedListBox
Asked by
Naresh
Top achievements
Rank 1
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or