So I have this DataGridView with two columns which are named "Phone1" and "Phone2".
The problem is when Phone1 is empty it can be that in Phone2 there is a phone number. How can I check in C# if Phone1 is empty but when Phone2 isn't, the text from Phone2 goes to Phone1?
Assuming the following input, which Phone1
doesn't have value in the second and third rows:
┌───────────┬───────────┐
│ Phone1 │ Phone2 │
├───────────┼───────────┤
│ 1111111 │ 2222222 │
│ │ 3333333 │
│ │ 4444444 │
│ 5555555 │ │
└───────────┴───────────┘
It's the expected output, which value of Phone2
has been shown as a fallback:
┌───────────┬───────────┐
│ Phone1 │ Phone2 │
├───────────┼───────────┤
│ 1111111 │ 2222222 │
│ 3333333 │ 3333333 │
│ 4444444 │ 4444444 │
│ 5555555 │ │
└───────────┴───────────┘
So, ho can I show value of the second column in the first column as a fallback if first column is empty?