I am getting an
InvalidCastException was unhandled by user:
Conversion from String "ORDERDATE" to type "Integer" is not valid.
The error hits when it gets to the lines with band.SortedColumns.
Any idea why i get this error?
I have the same code for infragistics UltraWinGrid vb.net and I don’t get that error.
UltraWebGrid1.DataSource = Nothing
myDataName = Generic.getPrevOrder(dt, username)
UltraWebGrid1.DataSource = dt
Dim band As Infragistics.WebUI.UltraWebGrid.UltraGridBand = UltraWebGrid1.DisplayLayout.Bands(0)
UltraWebGrid1.DisplayLayout.ViewType = Infragistics.WebUI.UltraWebGrid.ViewType.OutlookGroupBy
band.SortedColumns.Add(band.Columns("ORDERDATE"), True)
band.SortedColumns.Add(band.Columns("ORDERID"), False)
This could be nothing, but out of curiosity, what happens if you swap these around:
to
It could be that the schema of the layout (
UltraWebGrid1.DisplayLayout.Bands(0)) is different to what is expected? I can’t see why it should make a difference, but it’s worth ruling it out.