比如要使cloumn【0】禁止列排序               
this.dataGridViewLED.Columns.SortMode = DataGridViewColumnSortMode.NotSortable;

 

 

//禁止每一列点击标题排序
for(inti=0;i<dataGridView1.Columns.Count;i++)
{
dataGridView1.Columns[i].SortMode=DataGridViewColumnSortMode.NotSortable;
}

 

//防止点击列标题时出现e.rowIndex=-1报错

if(e.rowIndex==-1)

{

return;

}

相关文章:

  • 2021-07-20
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2022-03-05
  • 2022-12-23
猜你喜欢
  • 2021-08-21
  • 2022-12-23
  • 2021-06-11
  • 2022-12-23
  • 2022-12-23
  • 2021-05-24
相关资源
相似解决方案