Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

C# Sorting a DataGridView by one column then by another

$
0
0
I have data which includes multiple columns. I want the data in the DataGridView to be sorted by one column (Status) and then sorted by another column (UserName). Currently I have the following sorted by only Status Ascending. I'd like it sorted by Status and then UserName. Any ideas?
private void Form1_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'DataDataSet.v_ActiveUserWorkstationDirectory' table. You can move, or remove it, as needed.
            this.v_ActiveUserWorkstationDirectoryTableAdapter.Fill(this.DataDataSet.v_ActiveUserWorkstationDirectory);
            this.dataGridView1.Sort(this.statusDataGridViewTextBoxColumn, ListSortDirection.Ascending);
	}


Please mark my post as helpful or the answer or better yet.... both! :) Thanks!


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>