Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
414
Bound grid: how to force a newline while editing a cell with Ctrl-Enter?
posted

Hi, currently the cell editing behavior seems to allow a user to add a newline as the cell text content by press "Shift-Enter".

Now our users complain, that they want a MS Access like behavior, where they use a "Ctrl-Enter" to get a newline in the cell text.
My question: how can I get this behavior within UltraGrid, that is bound to a DataTable?

If possible, I like to know a solution for IG 2007.3, but at least for the newest release there should be a solution... -or not? 

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

     When a normal text cell in the grid goes into edit mode,the grid displays a DotNet TextBox control to allow editing. So it's this control that is responding to the keys. My guess is that you would have to trap the KeyDown of the grid and modify the contents of the cell yourself or maybe access the TextBox control and set it's SelectedText. You can get to the TextBox by using grid.Controls[0] - assuming a cell is in edit mode. 

Children