Hi, I don't see a current post, so here it is. I have a WebDateTimeEditor below. I have the properties set, I've even tried setting them in code-behind, but nothing seems to change the format. When I attach the columnkey property to my grid field, the data is presented as Mon May 23 00:00:00 CDT, instead of 5/23/2011. I tried a format string of mm/dd/yyyy, but the online help only showed g for short date string. Also, when I click it to edit ti shows the date/time format of __/__/____ __:__. This of course is not correct either. If I should just be using a different format string, other than mm/dd/yyyy, what is it since help only shows "g" in the code-behind sample? Thanks.
<ig:WebDateTimeEditor ID="dtPerformancePlanCompletedDate" runat="server" BackColor="yellow" DataMode="DateOrDBNull" DisplayModeFormat="g" EditModeFormat="g" Nullable="true" NullText="Select a Date" columnkey="COMPLETEDDATE"></ig:WebDateTimeEditor>
Hello Dbishop9,
The format of the datetime column in your grid needs to be the same like in the WebDataTime editor. If you apply a short date time for the grids column the results should appear as expected.
Try this approach and let me know if it works for you.
Also you can attach your sample here and I could investigate and modify it.
Looking forward to hear from you
Sincerely,
Georgi Sashev
Developer Support Engineer
Infragistics, Inc.
http://www.infragistics.com/support
Thanks, Georgi. Below is the format I have for the grid column in the InitializeLayout method. But I'm not familiar with the date formatting for the WebDateTime editor of "g" (see previous post). Is this the correct format code to use in the WebDateTime editor or should I be using something else? And the code below correct for the grid column?
.DataType = "System.DateTime".Format = "MM/dd/yyyy"
The format is correct. Also you can try to change it to “d” and test if there will be a difference.
I can recommend you to follow this sample here for more details:
http://samples.infragistics.com/aspnet/Samples/WebDataGrid/Editing-and-Selection/Editing-Editor-Providers/Default.aspx?cn=data-grid&sid=12b48e9e-8ffb-4c61-837c-58118040f669
Looking forward to hear from you.
Hi Georgi. Thanks for the info. I've changed the formats to "d", but they still don't display correctly. The Editing Format works, but the Display Format is lost somewhere. Also, the samples pages don't provide any real information for this. I'm not sure how I am going to fix this. I have to use some type of date editor and this seems to be the only one that will actually work, except for this simple formatting issue. Is there a way to set this client-side? Like when the control initializes? I've tried setting it when the row initializes, but that doesn't work either.
Can you provide me with a sample code? This way I will be able to investigate this issue further and to advise you how to solve ti.