user3181689
user3181689

Reputation: 241

cxGrid expand row height to new line with enter

This is a little hard to explain so please bear with me. When I am editing a text field in one of the columns I would like to,when I hit enter, go to new line under the edited text so the grid basically expands. Options-View-CellAutoHeight set to true expands the cell but editing is terrible.Cant see a thing where the first line is,where it ends,etc...

Here is the grid:

enter image description here

I can not go after the last letter 'a' with my mouse cursor and hit enter so another line gets added. Which settings regulate this ? I know it can be done since I had a grid once and could do this.

EDIT: This requires no code just applied settings.

Upvotes: 1

Views: 4046

Answers (1)

Guillem Vicens
Guillem Vicens

Reputation: 3996

Just tested it with DevExpress VCL 13.2 and it can be easily done without coding (if I understood what you want to achieve).

Basically, you need to set following properties:

  • Assign a Memo to the Properties of your column and make sure its WantReturns property is set to true.
  • In your TableView set the OptionsView.CellAutoHeight property to true.
  • Also in your TableView, set the OptionsBehavior.EditAutoHeight to either eahEditor (editor is sized vertically to fit the content) or eahRow (the entire row is sized when editing) as needed.

Upvotes: 6

Related Questions