Sorting on column of ImageCellType

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

  • Posted 8 September 2017, 12:39 pm EST

    <FONT face=Arial size=2>We have specified a column to use ImageCellType as follows:</FONT>


    <FONT face=Arial size=2><font face="Lucida Console" size="2">
    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)</FONT>


    <FONT face=Arial size=2>'Set imagecell for first column
    Dim imgCellType As New FarPoint.Win.Spread.CellType.ImageCellType
    imgCellType.Style = FarPoint.Win.RenderStyle.StretchAndScale</FONT>


    <FONT face=Arial size=2>objFpSpread.Sheets(0).Columns(0).CellType = imgCellType</FONT>


    <FONT face=Arial size=2>'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
    Else
    objFpSpread.Sheets(0).Cells(row, col).Value = objBitmapNotebook
    End If
    </font></FONT>


    <FONT face=Arial size=2>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.)</FONT>


    <FONT face=Arial size=2><font face="Lucida Console" size="2">
    'Sort the data on the specified column
    objFpSpread.ActiveSheet.SortRows(e.Column, True, False)
    </font></FONT>

  • 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