Question: I am using netbeans.
I have a table 'incident' with column 'priority' which can hold values priority 1 , priority 2.

I have created a jcombobox with 3 options - select all( to select all the rows) / priority 1(to select rows with priority 1 and so on) / priority 2. Options are passed through prioritybox.getSelected().
I want to know any possible sql statement so that if i select the option 'select all' , all the entries of the table should be selected.

If i choose priority 1 
then the statement 

```
  select * from incident where priority='"+prioritybox.getSelected()+"';

```

gets executed correctly i.e. it select the rows which having priority=priority1. But if i select the option 'select all ' then this statement becomes invalid as no such row is there with priority value = select all.I don't want to use if-else . Any other possible solution??

Answer: 
To remove image from column you need to restore default text alignment of your column after you removed image:

```
column.ImageIndex = -1;
column.TextAlign = HorizontalAlignment.Center;

```

Why it helped? Because when you are assigning image index >= 0 to column header, internally following method is called

```
ListView.SetColumnInfo(0x10, column);

```

Which changes text alignment of column

```
lParam.iImage = column.ActualImageIndex_Internal;
lParam.fmt |= 0x800;
lParam.fmt |= column.TextAlign;
UnsafeNativeMethods.SendMessage(new HandleRef(this, Handle), 
     NativeMethods.LVM_SETCOLUMN, column.Index, lParam);

```

But it does not change alignment back when you are setting image index to -1.
With a slight change in Sergey Berezovskiy answer, when you have different Text Alignments per column, you can also do;

```
column.ImageIndex = -1;
column.TextAlign = column.TextAlign;

```