好像不能,冻结就是不能移动,i列不能移动,后面的自然就挡住看不到了.
你可以控制i的前几列的是否可见,让后面的列显示

解决方案 »

  1.   

    楼主:建议换行吧。如果此列是冻结。那只有换行了。
      

  2.   

    遇到同样的需求问题,,期待有好的解决方法
      

  3.   

    兄弟,我解决了,,,研究了好久,,最终用一个变态的法子解决了,哈哈哈哈
            //按钮控制冻结
            private void button1_Click(object sender, EventArgs e)
            {
                if (dataGridView1.CurrentCell != null)
                {
                    int currentColumn = dataGridView1.CurrentCell.ColumnIndex;
                    if (currentColumn > -1)
                    {
                        for (int i = currentColumn - 1; i > -1; i--)
                        {
                            dataGridView1.Columns[i].Width = 10;//必须把前面的宽度设置小到可以看到进度条
                        }
                        FreezeBand(dataGridView1.Columns[currentColumn]);
                        for (int i = currentColumn - 1; i > -1; i--)
                        {
                            dataGridView1.Columns[i].Width = 80;//冻结完成后又把前面的宽度设置回来,否则就没有进度条了
                        }
                    }
                }
                else
                {
                    MessageBox.Show("请选中一列");
                }
            }
            private static void FreezeBand(DataGridViewBand band)
            {
                band.Frozen = true;
                DataGridViewCellStyle style = new DataGridViewCellStyle();
                style.BackColor = Color.WhiteSmoke;
                band.DefaultCellStyle = style;
            }
            //取消冻结
            private void button2_Click(object sender, EventArgs e)
            {
                int columnCount=dataGridView1.Columns.Count;
                for (int i = 0; i < columnCount;i++ )
                {
                    dataGridView1.Columns[i].Frozen = false;
                }
            }