Hello,
I want to set date format to "dd/mm/yyyy" for webdataGrid's MonthCalendarProvider. It works in the editing row but in the adding row the date format stills "mm/dd/yyyy". I tried with this code ;
MonthCalendarProvider1.EditorControl.Culture = System.Globalization.
CultureInfo.CreateSpecificCulture("fr-FR");
Please how to set date format to "dd/mm/yyyy" in WebDataGrid adding row ?
Hi gtarek,
I would suggest setting the DataFormatString of your date column to {0:dd/MM/yyyy} and using your MonthCalendar as the editor provider for your adding row field. Similarly to the CellEditing behavior, RowAdding has a collection of column settings which allows you to assign providers to the new row input fields.
Please let me know if this helps.
Best Regards,
Petar IvanovDeveloper Support EngineerInfragistics, Inc.http://www.infragistics.com/support
Hi Peter,
I want only d//mm/yyyy format.Whenever I want to get the date from the UI It is taking as "Day Mon Date hours " like. Do I need to do some modification in .aspx page.Following changes I have made
FormatDataString="{0:MM/yyyy}"
FormatDataString="{0:d}"
FormatDataString="{0:dd/mm/yyyy}"
But when I debug my application It is taking in JavaScript like "Day Mon Date hours " like Tue Sep 15 00:00:0000 EDT. It should be like dd/mm/yyyy.
Below is the line of code I am using in .aspx page:
<InfragisticsUPG:BoundDataField Header-Text="Regulatory Action Date" Key="RegActionDate" Width="120px" DataFieldName="RegActionDate" DataType="System.String" DataFormatString="{0:d}">
Thanks
Hello Shyam,
The column's DataType needs to be set as "System.DateTime" in this case. As well as that the incoming data has to be an actual DateTime object in order for the grid to recognize it as such and apply the format string.
Hope this helps.
Thanks Peter,
Yes, you are right. It should be DateTime.