Conditional Assignment



Hi All,

I have the following code in C#:

lSelectedFilter = 1;
this.tabFilters.SelectedIndex = (lSelectedFilter == 0 ? 0
: lSelectedFilter - 1);

After executing the above statements, this.tabFilters.SelectedIndex is
changed to -1. Why? I expected it to be 0. Anyone can explain it to me?

Thanks!

-Emily

.