Welcome Guest Search | Active Topics | Sign In | Register

Set PickerFormat of a DateTimeColumn at runtime Options
Camarate
Posted: Thursday, June 27, 2013 9:46:14 PM
Rank: Advanced Member
Groups: Member

Joined: 9/2/2010
Posts: 120
Hi,

By default one date in the Picker of a DateTimeColumn is shown in MM/dd/yyyy format. To change this, I need to set the PickerFormat parameter in my grid, right?

I'm developing an ASP.NET application that will work in multiple languages​​. Thus, when in Portuguese, the date of the Picker of a DateTimeColumn should be shown in "dd/MM/yyyy" format, whereas when in English, should be in "MM/dd/yyyy" format. The choice of language will be made at runtime.

So, how can I set the PickerFormat of the grid at runtime?

Thanks in advance,

Marcelo Camarate
eo_support
Posted: Thursday, June 27, 2013 11:05:12 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

You will need to modify the corresponding ItemTemplate's DatePicker object. First, you will need to make sure you have a <eo:DateTimeColumn> inside the Grid's ColumnTemplates collection. You can then use the following code:

Code: C#
//Get the template column
EO.Web.DateTimeColumn template = 
    (EO.Web.DateTimeColumn)Grid1.ColumnTemplates[column_index];

//Modify its PickerFormat
template.DatePicker.PickerFormat = new_format;


Hope this helps.

Thanks!
Camarate
Posted: Monday, July 1, 2013 11:01:23 AM
Rank: Advanced Member
Groups: Member

Joined: 9/2/2010
Posts: 120
Hi,

It's working fine. Thank you so much.

Regards,

Marcelo Camarate


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.