在dataGridView读取了excel表格后 老大说想在dataGridView的最左边让它自动排序。 这就让我有点懵圈,百度了下看到了许多实现方法,但都由于某些原因不能实现。 最后找到了个方法可以实现,记录下
在主函数中加入这一类
private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
{
Rectangle rectangle = new Rectangle(e.RowBounds.Location.X,
e.RowBounds.Location.Y,
dataGridView1.RowHeadersWidth - 4,
e.RowBounds.Height);
TextRenderer.DrawText