Controlling Display Position And Appearance Of Item In List View
<p>I am developing an application where i will need to print the contents of a listview taken from a database. I have successfully displayed the listview,but i need to add an aggregate grouping of the total amount paid in the report and view it.I have done this(from my query..but i need this data to be under the "LAST TWO" columns of the listview and not the first two.In addition, i also want this items to be centered, and will want the font to be bold.How can i achieve this. Below is my code so far:</p>

<pre><code>           //setting up command 
            OdbcCommand commandSql = new OdbcCommand("SELECT stateid,surname,firstname,amount FROM scheduledpayment", _connection);
            OdbcDataReader odr = commandSql.ExecuteReader();
            while (odr.Read())
            {
                ListViewItem item = new ListViewItem(odr["stateid"].ToString());
                item.SubItems.Add(odr["surname"].ToString());
                item.SubItems.Add(odr["firstname"].ToString());
                item.SubItems.Add(odr["amount"].ToString());
                listView1.Items.Add(item);
            }
             OdbcCommand commandSql2 = new OdbcCommand("SELECT sum(amount) amount FROM scheduledpayment", _connection);
            OdbcDataReader odr2 = commandSql2.ExecuteReader();
            while (odr2.Read())
            {
                ListViewItem item3 = new ListViewItem("Total");
                item3.SubItems.Add(odr2["amount"].ToString());

                listView1.Items.Add(item3);
            }
</code></pre>

<p>And The OutPut Is:</p>

<pre><code> ------------------------------------------------------------------------  


              200502317 BLACK   GRAY    15000
              200604572 BROWN   PURPLE  45000
              Total     789900
</code></pre>

<p>How can i make the output of the listview look like:</p>

<pre><code>              200502317 BLACK   GRAY    15000
              200604572 BROWN   PURPLE  45000
                                Total  789900
</code></pre>

<p>Thanks.</p>
