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
810
Datetime column Format ignored with Activation.ActivateOnly
posted

I have several datetime columns I display fine after setting col.Format = "yyyy-MM-dd HH:mm:ss.fff" but when I click on them I only see the date. If I set "col.CellActivation = Activation.NoEdit" then it displays fine but I cannnot even copy the value! I realize editing the value could be an issue but since ActivateOnly does not allow editing I don't see why the format should be ignored. Is there a way to turn this behavior off and keep my formatting but still be able to copy the cell as I have it formatted? On a related issue, it would be nice if we could text edit the datetime using the format we set even if we have to convert it ourselves if the datetime editor will not respect the format we set. Thanks, Dave

Parents
  • 69832
    Suggested Answer
    Offline posted

    UltraGridColumn separates the display of the cell text from the input validation using character masks. The MaskInput property determines what characters can be typed by the user; when the DateTimeEditor is in use, the date mask is generated from the current culture settings, and does not have any bearing on the format. In your case you can use the same tokens for year, month, day, hour, minute, and second, but the masking engine does not currently recognize the millisecond formatter ("f").

Reply Children
No Data