Can a gridview bound to a custom object (CSV file) be sorted?
<p>I have a Datagrid which is getting its data from CSV. No file is sorted in any order, but I want to order the gridview by Username (a field). How could this be done? My XML/gridview code looks like the following:</p>

<p>Streamwriter for writing to csv and populating gridview:</p>

<pre><code>    string filename = @"D:\www\isolated\LocalUser\cc-suppressions\generatedsuppressions\surpressions.csv";
    StreamWriter sWriter = new StreamWriter(Server.MapPath("Surpression.csv"));
    string Str = string.Empty;
    string headertext = "";
    sWriter.WriteLine(headertext);
    int cellLimit = GridView3.Rows[1].Cells.Count;
    for (int i = 0; i &lt;= (this.GridView3.Rows.Count - 1); i++)
    {
        for (int j = 0; j &lt;= (this.GridView3.Rows[i].Cells.Count - 1); j++)
        {
            Str = this.GridView3.Rows[i].Cells[j].Text.ToString();
            if (Str == "&amp;nbsp;")
                Str = "";
            Str = (Str + ",");
            sWriter.Write(Str);
        }

        sWriter.WriteLine();
    }
    sWriter.Close();
    sWriter.Dispose();
}
this.GridView3.DataBind();
</code></pre>
