Is it possible to have Multi-line DataGridView cells without wrapping text?

前端 未结 7 1984
暖寄归人
暖寄归人 2021-02-14 07:47

I know I can set WrapMode to true on the DefaultCellStyle of the RowTemplate, however this doesn\'t give me the behaviour I want. I am dis

7条回答
  •  深忆病人
    2021-02-14 08:07

           if ((!e.Value.Equals("OK")) && e.ColumnIndex == 6)
            {
                e.CellStyle.WrapMode = DataGridViewTriState.True;
                //dgvObjetivos.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
                dgvObjetivos.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;
            }
    

    http://kshitijsharma.net/2010/08/23/showing-multiline-string-in-a-datagridview-cell/

提交回复
热议问题