I have a webdatagrid with a date time in an editable cell that's formatted to just show the date (and not the time). When I click on the cell, I have event handlers that trigger (for EnteringEditMode) and I want to use the handler to edit the text that appears in the edit box that pops up. Currently the text in the edit box that appears is showing the full date time when I only need the date portion of that. I'd be curious to know if there's a way to do this with just a datamask (like the one I have for the field itself when it's not being edited, making only the date appear), however, I'm also very interested to know if there's a way to edit the text manually so I can parse and modify strings in editable fields for other data types as needed.
I guess the operative question in general is for both EnteringEditMode and ExitingEditMode, how do I get the value of the text that's currently in the editable box.
Thanks
Hello,
The default behavior of the grid is showing only the date. You can see the attached sample below. If you want you can use our editor provider and you can set through them the mask that you need.
If you have further questions please feel free to contact us.
That doesn't nearly answer the questions I asked. I want to know how to edit the text manually using the EnteringEditMode event handler (in javascript) and also, how to get the text that is in the editable box (in the enteringeditmode event, the keydown event, and the exitingeditmode event).
You can see the attached sample. In the WDG_CellEditing_EnteringEditMode function you can see how I get and modify the text for current cell on enteringEditMode. You can apply the same logic on the other two events.
If you have further questions, please feel free to contact us.
Is there a way to get this display text during keyup or keydown events? I don't see set_displayText or get_displayText as part of the arguments for the keydown or keyup events.
The key up event is fired when the grid is on focus. If you want to modify the text on key up or key down you should get current column and current row from the grid and than you should change the text. You can write your custom logic for which column should happened this. You can see the attached sample below.