Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
こんにちは、ユーザーが列名をクリックしたときにそのグリッドをソートできないようにしたい Datagridview があります。助けてください。
次の 2 つのオプションがあります。
のプロパティを介してDataGridView。列の編集に移動し、SortMode オプションを NotSortable に変更します。
DataGridView
コードを通して。並べ替えを無効にする列ごとにこれを記述します。
dataGridView1.Columns[ColumnNumber].SortMode = DataGridViewColumnSortMode.NotSortable;