Apr 19, 2017, 5:08 PM
[CLOSED] GridPanel DateColumn off by -4 hours
I guess I could just add 4 hours to all datetimes, but thinking this must be some system configuration or settings that is causing this?
<%@ Page Language="vb" %>
<script runat="server">
Private Class GridDTO
Property ID As Integer
Property LastPublished As Date?
Property ChangeGuidance As String
End Class
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack AndAlso Not Ext.Net.X.IsAjaxRequest Then
Dim data As New List(Of GridDTO)
Dim X = New GridDTO With {.ID = 1, .LastPublished = Now, .ChangeGuidance = ""}
data.Add(X)
X = New GridDTO With {.ID = 2, .LastPublished = Now, .ChangeGuidance = "Test Guidance"}
data.Add(X)
X = New GridDTO With {.ID = 3, .LastPublished = Now, .ChangeGuidance = ""}
data.Add(X)
storeVerification.DataSource = data
storeVerification.DataBind()
End If
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Edit Grid</title>
</head>
<body>
<form id="Form1" runat="server">
<ext2:ResourceManager ID="ResourceManager1" runat="server" />
<ext2:Panel Title="Model Change Verification" runat="server" ID="pnlVerification">
<Items>
<ext2:GridPanel Title="Allocation Changes" runat="server" ID="grdAllocationsVerification" AutoScroll="true">
<Store>
<ext2:Store ID="storeVerification" runat="server" >
<Model>
<ext2:Model runat="server" IDProperty="ID">
<Fields>
<ext2:ModelField Name="ID"></ext2:ModelField>
<ext2:ModelField Name="LastPublished"></ext2:ModelField>
<ext2:ModelField Name="ChangeGuidance"></ext2:ModelField>
</Fields>
</ext2:Model>
</Model>
</ext2:Store>
</Store>
<ColumnModel>
<Columns>
<ext2:Column ID="Column1" runat="server" DataIndex="ID" Hidden="true"></ext2:Column>
<ext2:DateColumn Flex="1" runat="server" text="Last Published" DataIndex="LastPublished" Format="M/d/yyyy HH:mm:ss A" ></ext2:DateColumn>
<ext2:Column runat="server" DataIndex="ChangeGuidance" Text="Change Guidance" Editable="true">
</ext2:Column>
</Columns>
</ColumnModel>
</ext2:GridPanel>
</Items>
</ext2:Panel>
</form>
</body>
</html>
Last edited by fabricio.murta; May 16, 2017 at 6:48 PM.