Link to home
Create AccountLog in
Avatar of maloriopolium
maloriopolium

asked on

How to force a DataGrid cell to be single line

Hi,

I have a DataGrid in my application. The problem is when users are editing a cell in the grid, they can currently press Shift + Enter and enter text in a new line. I do not want to allow them to do this. Is there a property that you can set on the DataGrid to prevent this from happening? I cannot seem to find anything at the moment.

Thanks
Avatar of sudhijss
sudhijss
Flag of India image

I am not sure if there is any such property. If you dont find any, you can use the keyup or the keydown event to cancel the keypress if the key could result in a newline.
Avatar of maloriopolium
maloriopolium

ASKER

Hmmm, I would have thought that this was a pretty common thing. If a datagrid by default is multiline, surely there must be a way to make it single line?
Anyone>?
ASKER CERTIFIED SOLUTION
Avatar of maloriopolium
maloriopolium

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account