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

How to hide selection / focus?

2 Answers 437 Views
CheckedListBox
This is a migrated thread and some comments may be shown as answers.
Entropy69
Top achievements
Rank 1
Veteran
Entropy69 asked on 04 Dec 2020, 09:34 AM

Even when the control loses focus, the selected row remains highlighted.
How to get the selected item to have the same style like the non selected items? 

I just want to be able to check or uncheck the items, focus is not important and therefore there should not be a visible difference.

Expected something like this but it does not work:

ClassificationCheckedListBox.Focusable = False;
ClassificationCheckedListBox.AllowShowFocusCues = False;

Also trying some things from the selectedindex changed event like this does not do it:

ClassificationCheckedListBox.FocusedElement.ResetLayout(True);

Any clue appreciated 

2 Answers, 1 is accepted

Sort by
1
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 07 Dec 2020, 09:55 AM
Hello, Walther,    

By default, RadCheckedListBox indicates the currently active and selected item with a border and orange fill color. If the control loses focus, the selected indication remains even though with a lighter color.

If I understand your requirement correctly, you want to eliminate the border and fill color and to disable the color indication no matter whether the control is focused or not. This can be easily achieved by handling the VisualItemFormatting event:
        public RadForm1()
        {
            InitializeComponent();

            this.radCheckedListBox1.VisualItemFormatting+=radCheckedListBox1_VisualItemFormatting;
        }

        private void radCheckedListBox1_VisualItemFormatting(object sender, ListViewVisualItemEventArgs e)
        {
            e.VisualItem.DrawFill = false;
            e.VisualItem.DrawBorder = false;
        }

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

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

0
Entropy69
Top achievements
Rank 1
Veteran
answered on 07 Dec 2020, 12:53 PM
Did the trick, thnx!
Tags
CheckedListBox
Asked by
Entropy69
Top achievements
Rank 1
Veteran
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Entropy69
Top achievements
Rank 1
Veteran
Share this question
or