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
135
removing column grouping looses column sort
posted

I have a simple grid of driving records, multiple records per driver. I can set specific columns for sorting (Driver, record type, proceessed date, sequence no) and have it set so the user cannot change this default sorting. When the grid initally populates all records are visible, no hierarcical display. The sort indicators appear in the appropriate column headers. I drag the Driver column header up to the grids title bar so the records are grouped by driver. All is fine at this point, I can open any of the drivers records (by clicking on the plus sign next to their name) and the records are all sorted as they should be. Very nice.

Now, I drag the driver column header back down to the grid, it ungroups the rows, but the sort indicator on the Driver column is lost, and the drivers records are all mixed together. I insure the headers are not sortable by the user.

So my question is, is there an event or method i can use to re-establish the sort criteria on the Driver column once the column is removed from the grouping header? Does this require client (JAVA) code? 

     ... assign data source to  grid ...

        Me.ultraDriverInfo.Clear()
        Me.ultraDriverInfo.DisplayLayout.AutoGenerateColumns = False
        Me.ultraDriverInfo.DisplayLayout.AllowSortingDefault = Infragistics.WebUI.UltraWebGrid.AllowSorting.No
        Me.ultraDriverInfo.DisplayLayout.HeaderClickActionDefault = Infragistics.WebUI.UltraWebGrid.HeaderClickAction.Select
        Me.ultraDriverInfo.Columns.Add(UltraCreateColumn("Driver", "DriverCode", "string", 60))
... more column construction....

        Me.ultraDriverInfo.DataBind()
        Me.ultraDriverInfo.Bands(0).SortedColumns.Add(Me.ultraDriverInfo.Columns.FromKey("DriverCode"))
        Me.ultraDriverInfo.Bands(0).SortedColumns(0).SortIndicator = Infragistics.WebUI.UltraWebGrid.SortIndicator.Ascending
        Me.ultraDriverInfo.Bands(0).SortedColumns.Add(Me.ultraDriverInfo.Columns.FromKey("ProcessedDate"))
        Me.ultraDriverInfo.Bands(0).SortedColumns(1).SortIndicator = Infragistics.WebUI.UltraWebGrid.SortIndicator.Descending
        Me.ultraDriverInfo.Bands(0).SortedColumns.Add(Me.ultraDriverInfo.Columns.FromKey("Description"))
        Me.ultraDriverInfo.Bands(0).SortedColumns(2).SortIndicator = Infragistics.WebUI.UltraWebGrid.SortIndicator.Ascending
        Me.ultraDriverInfo.Bands(0).SortedColumns.Add(Me.ultraDriverInfo.Columns.FromKey("SequenceNo"))
        Me.ultraDriverInfo.Bands(0).SortedColumns(3).SortIndicator = Infragistics.WebUI.UltraWebGrid.SortIndicator.Ascending
 

end the 'show' button click event... 

   Private Function UltraCreateColumn( _
      ByVal sCaption As String, ByVal sCol As String, ByVal sType As String, ByVal iWidth As Int16, Optional ByVal bMultiline As Infragistics.WebUI.UltraWebGrid.CellMultiline = Infragistics.WebUI.UltraWebGrid.CellMultiline.Yes) _
      As Infragistics.WebUI.UltraWebGrid.UltraGridColumn

        Dim wc As Infragistics.WebUI.UltraWebGrid.UltraGridColumn
        wc = New Infragistics.WebUI.UltraWebGrid.UltraGridColumn
        wc.Header.Caption = sCaption
        wc.BaseColumnName = sCol
        wc.Key = sCol
        wc.DataType = sType
        If sType = "datetime" Then
            wc.Format = "MM/dd/yyyy"
        End If
        wc.Width = iWidth
        wc.Header.ClickAction = Infragistics.WebUI.UltraWebGrid.HeaderClickAction.NotSet
        '        wc.CellMultiline = bMultiline
        UltraCreateColumn = wc
    End Function

ok, so it's ugly, but it works and I'm just learning this stuff, OK? 

So, any ideas?

Thanks in advance.

Steve