DateTime format for grid column

Hi,

Can I do DateTime format for a grid column? I have a field that is DateTime, and I want to display MONTH YEAR (like in September 2007) format. Is that possible inside the grid?

Thanks,
Jitesh

3 Replies

MN Muthulakshmi N Syncfusion Team August 31, 2010 05:51 AM UTC

Hi Jitesh,

Thank you for your details.

Using below xaml code you can display the month and year of the given Date as your wish.

[xaml code]











We have prepared a sample based on your request. Please download the sample from the below location.

Link:
http://www.syncfusion.com/uploads/redirect.aspx?file=WpfApplication1_9769db29.zip&team=development

Let us know if you need any details.

Regards,
Muthulakshmi


VJ Valiyaveettil Jitesh Ramanathu August 31, 2010 07:25 PM UTC

This one worked for me.






gave me the date as SEP 2010, which is what I wanted.

Thanks,
Jitesh


MN Muthulakshmi N Syncfusion Team September 2, 2010 11:09 AM UTC

Hi Jitesh,

Thank you for your details.

We have modified the “GridCellDateTimeEditCellRenderer.cs” file also prepared a sample which illustrates your request. Please download the sample from the below location.

Link:
http://www.syncfusion.com/uploads/redirect.aspx?file=WpfApplication1_61961e3c.zip&team=development


C# code for add new cell type to GridControl:

this.grid.Model.CellModels.Remove("DateTimeEdit ");
datagrid.Model.CellModels.Add("DateTimeEdit", new CustomGridCellDateTimeEditCellModel());

Let us know if you need any details.

Thanks,
Muthulakshmi



Loader.
Up arrow icon