How do you code for displaying a date in the RowEditingTemplate? This is just for display purposes.
Hi davefevold,
The syntax depends upon the control you want to display the date in. Are you going to use one of our controls, such as a DateTimeEditor or WebMonthCalendar? I could give you the code for those. Let me know.
regards,David Young
I'm using the WebDateTimeEditor.
Thx!
Hey,
Here is the binding for a date time editor.
<ig:RowEditingClientBinding ColumnKey="BirthDate" ControlID="control_BirthDate"
GetValueJavaScript="$find({ClientID}).get_value()"
SetValueJavaScript="$find({ClientID}).set_value({value})" />
I believe you'd have to take out the GetScript one so that it does not update. Or just set the editor as read only in the RET.
-Dave
Dave, I'm using VB instead of C# so I'm using the following code:
<
ig:RowEditingClientBinding ColumnKey="Lift_Date" ControlID="wdte1"
/>
The date is the displayed as "Fri Jun 11 00:00:00 CDT 2010"
I would like it to display as a ShortDateTime "d" = "6/11/2010" as requested:
ig:WebDateTimeEditor ID="wdte1" runat="server" BackColor="LightGray"
DisplayModeFormat="d" ReadOnly="True" Height="20px" Width="75px">
</ig:WebDateTimeEditor>
Thanks,
DF
Any more thoughts on how to display date in mm/dd/yyyy format?
Sorry about the delay. Where exactly are you getting the wrong format? In your cells in the data grid or in the date time editor in the row edit template. If it is the latter, is it all the time or just when it has focus. Once you let me know, I should be able to give you code to get the correct format.
I changed the code as suggested. The date being displayed is just the current date now instead of the column's date value.
As I suggested above, can you have your row edit template binding set to something like below:
When you do $get..., you're just finding the input, not actually setting the date value of the editor. With all of that, I am getting the date in the format you want.
In the row edit template...I have it as "read only"...when the date initially displays it looks like "Mon Aug 23 00:00:00 CDT 2010" then when I hover over the field it changes to "11/24/2001".