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
290
Inputting a string that is a DateTime Property WinGridCell
posted

Hi, 

I am just wondering if I can write text into a non string cell, like a DateTime type cell.

Though sounds confusing. This is what I want to happen.

On a DateTime property, a user can correctly input dates. However, we have a constant start date (01/01/0001) + End Date (31/12/9999) But instead of a user inputting these dates, I want them to input the word "min" (for 01/01/0001) and "max" (for 31/12/9999)

It just makes more sense to a user.

Is there any functionality of the WinGrid that can do this?

Cheers

Chris 

Parents
  • 469350
    Offline posted

    Hi Chris,

    This may be possible, but it's tricky. There's no simple way to do it, if that's what you're looking for.

    By default, the grid will use a DateTimeEditor for a DateTime cell and this editor has a mask which won't allow the user to type in letters. So you'd have to change the editor to something that allows text, like an UltraTextEditor. But this means you will lose the DateTimePicker in the dropdown. You could create your own using editor buttons, but it's no small task.

    Another option would be to try to use UltraCalendarCombo. This editor allows you to enter text and has a dropdown, so it's probably a better choice. But then you have the challenge of converting the entered text into a date before the editor tries to validate it. I think this might be possible using a DataFilter.

    I assume that once the user enters (min) and leaves the cell, you want the cell to show the actual date and not show "min" any more. Is that right? Or do you intend to maintain the textual display of what they entered? If the latter, then does it matter if the user enters "01/01/0001" and the cell changes it to "min?"

Reply Children
No Data