views:

1951

answers:

2

I'm using Webdatechooser<<Infragistics control>> for a column which takes the datetime. I need to convert the value entered (through the Webdatechooser) to dd-mmm-format.

Can I have snippets for that?

+1  A: 

The value is a DateTime object so you can use the ToString function of that object to generate the desired output.

((DateTime)WebDateChooser1.Value).ToString("dd-MMM-yyyy");

Should do it.

Lazarus
A: 
stack_pointer is EXTINCT
You should probably raise this as a new question if you want to see answers from anyone. However, I'd use the either an Infragistics (or similar) WebMaskEdit control with a mask that allows only alpha for the first three characters, has a fixed hyphen and then allows 2 digits or you could use javascript to capture each keypress and validate it yourself but that is rather overkill. Especially when you have the option to have dropdowns and to offer a more controlled list of options. Why free-form text for this input?
Lazarus