简体   繁体   中英

C# 3.5 datagridview column header click does not sorts

I have winform there is datagridview control when i click on column header it does not sorts. Can anyone advice me whats wrong?

Each column has "SortMode" property in datagridview control. SortMode Values : Automatic, NotSortable, Programmatic You could check SortMode property.

 private void dataGridView1_ColumnAdded(object sender, DataGridViewColumnEventArgs e)
        {
            e.Column.SortMode = DataGridViewColumnSortMode.NotSortable;
        }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM