Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
4110
UltraWebGrid date formatting issue
posted

I have an Ultrawebgrid that is loaded dynamically once when the page first loads, via sql dataset from a MSSQL2005 database. I am using the NET3.5, 10.3.20103.2134 version of the control(please do not suggest upgrade, as this is not an option). I have set the formatting in the InitializeLayout method and until recently the date has formatted just fine. Now, this grid, out of 15 total grids on the page, won't format the date. Except for one column name, all the grids are the same. I have included all the code below. I know we had 1 or 2 MS security udpates recently, but I would think that would effect all my grids, not just the one and I am having no luck tracking down the problem. I can't provide a data sample, but all the raw records have a proper sql date format of yyyy-mm-dd hh:mm:ss that I am formatting to MM/dd/yyyy. Thanks for any help you can provide.

Try
ds = GetDataSet("loadMYDATA", Profile)
If Not IsDatasetValid(ds) Then
ds = GetDataSet("emptyMYDATA")
m_MYDATACount = 0
Else
lblMYDATACount.Text = ds.Tables(0).Rows.Count
m_MYDATACount = ds.Tables(0).Rows.Count
End If
igMYDATA.DataSource = ds
igMYDATA.DataBind()
Catch ex As Exception
End Try

Protected Sub igMYDATA_InitializeLayout(ByVal sender As Object, ByVal e As Infragistics.WebUI.UltraWebGrid.LayoutEventArgs) Handles igMYDATA.InitializeLayout
With e.Layout.Bands(0).Columns.FromKey("ID")
.Header.Style.HorizontalAlign = HorizontalAlign.Center
.CellStyle.HorizontalAlign = HorizontalAlign.Center
.Hidden = True
End With
With e.Layout.Bands(0).Columns.FromKey("PROCESS")
.Header.Caption = "Process"
.Header.Style.HorizontalAlign = HorizontalAlign.Left
.CellStyle.HorizontalAlign = HorizontalAlign.Left
End With
With e.Layout.Bands(0).Columns.FromKey("MYDATA_NUMBER")
.Header.Caption = "MYDATA Number"
.Header.Style.HorizontalAlign = HorizontalAlign.Center
.CellStyle.HorizontalAlign = HorizontalAlign.Center
End With
With e.Layout.Bands(0).Columns.FromKey("ASSIGNED_OFFICE")
.Header.Caption = "Assigned To"
.Header.Style.HorizontalAlign = HorizontalAlign.Center
.CellStyle.HorizontalAlign = HorizontalAlign.Center
End With
With e.Layout.Bands(0).Columns.FromKey("DAYS_OPEN")
.Header.Caption = "Days Open"
.Header.Style.HorizontalAlign = HorizontalAlign.Center
.CellStyle.HorizontalAlign = HorizontalAlign.Center
End With
With e.Layout.Bands(0).Columns.FromKey("DUE_DATE")
.Header.Caption = "Due Date"
.Format = "MM/dd/yyyy"
.Header.Style.HorizontalAlign = HorizontalAlign.Center
.CellStyle.HorizontalAlign = HorizontalAlign.Center
End With
With e.Layout.Bands(0).Columns.FromKey("TYPE")
.Header.Style.HorizontalAlign = HorizontalAlign.Center
.CellStyle.HorizontalAlign = HorizontalAlign.Center
.Hidden = True
End With
With e.Layout.Bands(0).Columns.FromKey("INITIATION_DATE")
.Header.Caption = "Initiation Date"
.Format = "MM/dd/yyyy"
.Header.Style.HorizontalAlign = HorizontalAlign.Center
.CellStyle.HorizontalAlign = HorizontalAlign.Center
.Hidden = True
End With
End Sub

<igtbl:UltraWebGrid ID="igMYDATA" runat="server" DisplayLayout-AutoGenerateColumns="true"
EnableAppStyling="True" StyleSetName="Office2007Blue" StyleSetPath="~/ig_res/"
DisplayLayout-CellPaddingDefault="5" DisplayLayout-Pager-AllowPaging="true" DisplayLayout-Pager-PageSize="100"
DisplayLayout-Pager-PagerAppearance="Both" Height="350px" Width="100%" DisplayLayout-AllowSortingDefault="Yes">
<Bands>
<igtbl:UltraGridBand>
<AddNewRow View="NotSet" Visible="NotSet">
</AddNewRow>
</igtbl:UltraGridBand>
</Bands>
<DisplayLayout BorderCollapseDefault="Separate" CellPaddingDefault="5" Name="igMYDATA"
RowHeightDefault="20px" Version="4.00" HeaderClickActionDefault="SortSingle">
<FrameStyle>
</FrameStyle>
<Pager Alignment="Left" AllowPaging="True" PagerAppearance="Both" PageSize="100"
QuickPages="3" StyleMode="Numeric" MinimumPagesForDisplay="2">
<PagerStyle HorizontalAlign="Left" VerticalAlign="Middle" />
<ComboStyle HorizontalAlign="Left" VerticalAlign="Middle">
</ComboStyle>
</Pager>
<ActivationObject BorderColor="" BorderWidth="">
</ActivationObject>
</DisplayLayout>
</igtbl:UltraWebGrid>