Search code examples
c#winformslistviewselectiondefault

C# Listview avoid default row selection


I have Listview with Checkboxes enable and whenever it gets loaded the very first row gets selected by default. And I'm not setting it in the code.

So how can I avoid this default selection of the first row?


Solution

  • You can set the SelectedIndex to -1 when you load your form

    listView1.SelectedIndex = -1;