Sorting on column of ImageCellType

Posted by: sholok on 8 September 2017, 12:39 pm EST

  • Posted 8 September 2017, 12:39 pm EST

    We have specified a column to use ImageCellType as follows:

    Dim objStreamNothing As System.IO.Stream
    Dim objStreamNotebook As System.IO.Stream
    Dim objBitmapNothing As Bitmap
    Dim objBitmapNotebook As Bitmap
    objStreamNothing = Me.GetType().Assembly.GetManifestResourceStream("NOTHING.BMP")
    objStreamNotebook = Me.GetType().Assembly.GetManifestResourceStream("NOTEBOOK.BMP")
    objBitmapNothing = New Bitmap(objStreamNothing)
    objBitmapNotebook = New Bitmap(objStreamNotebook)

    'Set imagecell for first column
    Dim imgCellType As New FarPoint.Win.Spread.CellType.ImageCellType
    imgCellType.Style = FarPoint.Win.RenderStyle.StretchAndScale

    objFpSpread.Sheets(0).Columns(0).CellType = imgCellType

    'Binding Data to FpSpread in a LOOP after fetching from DB.
    If Len(dsBindingSource(row)(I).ToString) < 1 Then
    objFpSpread.Sheets(0).Cells(row, col).Value = objBitmapNothing
    objFpSpread.Sheets(0).Cells(row, col).Value = objBitmapNotebook
    End If

    Now when we try to sort the column based on the images under objFpSpread.CellClick event, sorting doesn't take place in the desired way. (Desired Way of sorting: Similar type of images grouped together followed by the other type of image, since we have only 2 types of images.)

    'Sort the data on the specified column
    objFpSpread.ActiveSheet.SortRows(e.Column, True, False)

  • Replied 8 September 2017, 12:39 pm EST

    You can try using the sortinfo object and the comparer property.  How are your images being sorted?
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels