CheckBox inverted c # [closed]

-1

I have this code.

I'm reading the top-down checkboxes when they have all been selected. But what I needed was, when he started to read, I wanted him to start reading from 2.9.15 up. And not from 2.9.16 down.

foreach (UltraListViewItem item in listView.Items)
{
    if (item.CheckState == CheckState.Checked)
    {
        DataTable versionToUpdateDT = mUpdater.GetVersionToUpdate((int)item.Tag);
        mVersionSelect = item.Text;
    }    
}

I do not know if this is possible.

    
asked by anonymous 16.05.2017 / 13:17

1 answer

2

Yes it is possible, but not using foreach . In this case, use the command for :

for (int x = listView.Items.Count-1; x >= 0; x--)
{
     UltraListViewItem item = listView.Items[x];
     // aqui continua o seu código
}
    
16.05.2017 / 13:35