How do I place an icon into the flter values instead of Null?

Posted by: martin.teefy on 6 November 2018, 2:35 am EST

    • Post Options:
    • Link

    Posted 6 November 2018, 2:35 am EST

    Hi,

    I have columns having either one of two values in the filter list: blank or Null (for the icon from a imagelist set in the flexgrid rows for that column)

    When I click on the filter i see only 2 values in the values list, blank is correct i.e. rows without the icon and Null for the icon. The filtering actually works Ok but I can’t have Null as an option for the end-user t filter for the icon only rows…

    So my question is is it possible to replace the text of Null with either a word representing the column e.g. UserAlert or have the actual icon placed there from the imagelist?

    BTW I’ve seen the sample on grapecity’s site about loading pictures of employees into the filter list from the access database - these pictures can be replaced by the icon from the imagelist but this is not the solution as each row has an associated imagelist icon row in the filter list.

    I need the filter list to continue to have 2 rows, blank and the icon (or the word for it)

    Thanks Martin

  • Posted 7 November 2018, 8:07 pm EST

    Forget to mention i’m using the Flexgrid version 2.0.20153.102 with Vb.net because the system was converted from VB6 many years ago and now we need to use the filtering of the grid in earnest…

    So is it possible to changed the value (null) to either the column header name or replace (null) with an icon.

  • Posted 7 November 2018, 10:36 pm EST

    Hi,

    I’ve modified the Employee Image filter list sample according to your needs.

    Please see the attached sample.

    Regards,

    Jitender

    FilterIconList.zip

  • Posted 8 November 2018, 12:50 am EST

    Jitender,

    Looks great but has an error when I open the project, it doesn’t like the character $. Give the error character is not valid.

    Routine FillData

    Line: C1FlexGrid1(i, 1) = $“Row-{i}”

    Thanks

    Martin

  • Posted 8 November 2018, 1:10 am EST

    Jitender,

    I’ve corrected the randomising of the row naming and the filtering works - Great!!!

    Will try to incorporate it into my project…

    Thanks

    Martin

  • Posted 8 November 2018, 2:25 am EST - Updated 3 October 2022, 4:45 pm EST

    Jitender,

    It partially works in my project, the total grid count is 1683 and selecting the blank value filters the list to 1671 but selecting only the icon from the imagelist produces an empty grid?

    My code:

            lvwListView.Visible = False
    
            ' Start Putting the Icon into the filter values list
            Dim imageMap = New Dictionary(Of String, Image)
            imageMap.Add("FileSaved", Me.imlIconsSmall.Images.Item(gstrICON_ITEM_FILE_SAVED))
    
            flxMain.ColumnCollection.Item(flxMain.ColumnCollection.IndexOf(gstrCOL_KEY_FILE_SAVED)).ImageMap = imageMap
            flxMain.ColumnCollection.Item(flxMain.ColumnCollection.IndexOf(gstrCOL_KEY_FILE_SAVED)).ImageAndText = False
            flxMain.ColumnCollection.Item(flxMain.ColumnCollection.IndexOf(gstrCOL_KEY_FILE_SAVED)).ImageAlign = C1.Win.C1FlexGrid.ImageAlignEnum.CenterCenter
    
            Dim editor = flxMain.ColumnCollection.Item(flxMain.get_ColIndex(gstrCOL_KEY_NAME)).Filter.GetEditor()
    
            ' Comment this line if you only want (Blank + column header) in filter list
            AddHandler flxMain.MouseClick, AddressOf flxMain_MouseClick
    
            flxMain.Visible = True
    

    ’ gstrCOL_KEY_NAME is Name (the first column which has a unique value) where you used .Cols(1).Filter.Editor

    ’ gstrCOL_KEY_NAME is FileSaved

    ’ My version of the grid doesn’t have .flxmain.Cols(2) so I’ve used flxMain.ColumnCollection.Item(flxMain.ColumnCollection.IndexOf(gstrCOL_KEY_FILE_SAVED))

    Private Sub flxMain_MouseClick(sender As Object, e As MouseEventArgs)
    
        Dim hitTestInfo = flxMain.HitTest(e.Location)
    
        On Error GoTo VB_Error
    
        If mblnLoading Then
            Exit Sub
        End If
    
        If hitTestInfo.Column = flxMain.get_ColIndex(gstrCOL_KEY_FILE_SAVED) AndAlso hitTestInfo.Type = HitTestTypeEnum.FilterIcon Then
            ResizeFilterWindow()
        End If
    
        Exit Sub
    

    VB_Error:

        Call gReportError(gstrVBUnexpectedErrorText("flxMain_MouseClick"), MsgBoxStyle.Critical, Me.Text, Err.Number)
    
    End Sub
    
    Private Sub ResizeFilterWindow()
    
        On Error GoTo VB_Error
    
        For Each frm As Form In Application.OpenForms
    
            If frm.Name = "FilterEditorForm" AndAlso frm.GetType().ToString() = "C1.Win.C1FlexGrid.FilterEditorForm" Then
    
                mfrmFilterForm = frm
    
                AddHandler frm.FormClosing, AddressOf Frm_FormClosing
                AddHandler CType(frm.Controls(0), ToolStrip).ItemClicked, AddressOf Frm_ItemClicked
                frm.Controls.RemoveAt(1)
    
                Dim c1List1 As C1.Win.C1List.C1List = New C1.Win.C1List.C1List()
                frm.Controls.Add(c1List1)
                c1List1.Caption = ""
                c1List1.Dock = DockStyle.Fill
                c1List1.ShowHeaderCheckBox = True
                c1List1.SelectionMode = C1.Win.C1List.SelectionModeEnum.CheckBox
                c1List1.DataMode = C1.Win.C1List.DataModeEnum.AddItem
                c1List1.ExtendRightColumn = True
                c1List1.ItemHeight = 24
                c1List1.Style.VerticalAlignment = C1.Win.C1List.AlignVertEnum.Center
    
                c1List1.Columns.Add(New C1.Win.C1List.C1DataColumn())
                c1List1.Columns(0).Caption = "(Select All)"
    
                c1List1.AddItem("")
                c1List1.AddItem(gstrCOL_KEY_FILE_SAVED)
    
                c1List1.Columns(0).ValueItems.Values.Add(New C1.Win.C1List.ValueItem("", ""))
                c1List1.Columns(0).ValueItems.Values.Add(New C1.Win.C1List.ValueItem(gstrCOL_KEY_FILE_SAVED, Me.imlIconsSmall.Images.Item(gstrICON_ITEM_FILE_SAVED)))
                c1List1.Columns(0).ValueItems.Translate = True
    
                Dim obj As Object
                Dim cf = flxMain.ColumnCollection.Item(flxMain.ColumnCollection.IndexOf(gstrCOL_KEY_FILE_SAVED))
                If (cf.Filter.IsActive) Then
                    For Each obj In (CType(cf.Filter, ValueFilter)).ShowValues
                        If (obj IsNot Nothing) Then
                            Dim rowIndex = c1List1.FindStringExact(obj.ToString(), 0)
                            c1List1.SelectedIndices.Add(rowIndex)
                        End If
                    Next
    
                End If
                Exit For
    
            End If
    
        Next
    
        Exit Sub
    

    VB_Error:

        Call gReportError(gstrVBUnexpectedErrorText("ResizeFilterWindow"), MsgBoxStyle.Critical, Me.Text, Err.Number)
    
    End Sub
    
    Private Sub Frm_FormClosing(sender As Object, e As FormClosingEventArgs)
    
        Dim iSelectedLoop As Integer
    
        On Error GoTo VB_Error
    
        Dim cf = flxMain.ColumnCollection.Item(flxMain.ColumnCollection.IndexOf(gstrCOL_KEY_FILE_SAVED))
    
        If mstrFilterActionString = "Apply" Then
            Dim lst = CType(mfrmFilterForm.Controls(1), C1.Win.C1List.C1List)
    
            Dim selList = New List(Of Object)
            For iSelectedLoop = 0 To lst.SelectedIndices.Count - 1
                Dim rowIndex = lst.SelectedIndices(iSelectedLoop)
                selList.Add(lst.Columns(0).CellValue(rowIndex))
            Next
    
            cf = flxMain.ColumnCollection.Item(flxMain.ColumnCollection.IndexOf(gstrCOL_KEY_FILE_SAVED))
    
            Dim vFilter = New ValueFilter()
            vFilter.ShowValues = selList.ToArray()
            cf.Filter = vFilter
    
        ElseIf mstrFilterActionString = "Clear" Then
            cf.Filter = Nothing
        End If
    
        Exit Sub
    

    VB_Error:

        Call gReportError(gstrVBUnexpectedErrorText("Frm_FormClosing"), MsgBoxStyle.Critical, Me.Text, Err.Number)
    
    End Sub
    
    Private Sub Frm_ItemClicked(sender As Object, e As ToolStripItemClickedEventArgs)
        If e.ClickedItem.Name = "_btnApplyFilter" Then
            mstrFilterActionString = "Apply"
        ElseIf (e.ClickedItem.Name = "_btnClearFilter") Then
            mstrFilterActionString = "Clear"
        Else
            mstrFilterActionString = "Cancel"
        End If
    End Sub
    

    So can you see anything wrong that may stop the icon filter from showing the data?

    Thanks

    Martin

  • Posted 8 November 2018, 3:05 am EST

    Martin,

    Your grid’s ImageMap has this mapping:

    “FileSaved” → Me.imlIconsSmall.Images.Item(gstrICON_ITEM_FILE_SAVED)

    Your Filter’s ValueItems has this mapping:

    gstrCOL_KEY_FILE_SAVED → Me.imlIconsSmall.Images.Item(gstrICON_ITEM_FILE_SAVED)

    For filtering of icons to work correctly the keys need to be the same, so gstrCOL_KEY_FILE_SAVED should be equal to “FileSaved”. Or, you can also replace “FileSaved” with gstrCOL_KEY_FILE_SAVED in your grid’s ImageMap. Please see the value of gstrCOL_KEY_FILE_SAVED, and make the required changes.

    Let me know if this doesn’t work for you.

    Regards,

    Jitender

  • Posted 8 November 2018, 3:50 am EST

    Jitender,

    It doesn’t work, have I done it right?

            Dim imageMap = New Dictionary(Of String, Image)
            imageMap.Add(gstrCOL_KEY_FILE_SAVED, Me.imlIconsSmall.Images.Item(gstrICON_ITEM_FILE_SAVED))
    
            flxMain.ColumnCollection.Item(flxMain.ColumnCollection.IndexOf(gstrCOL_KEY_FILE_SAVED)).ImageMap = imageMap
            flxMain.ColumnCollection.Item(flxMain.ColumnCollection.IndexOf(gstrCOL_KEY_FILE_SAVED)).ImageAndText = False
            flxMain.ColumnCollection.Item(flxMain.ColumnCollection.IndexOf(gstrCOL_KEY_FILE_SAVED)).ImageAlign = C1.Win.C1FlexGrid.ImageAlignEnum.CenterCenter
    
            Dim editor = flxMain.ColumnCollection.Item(flxMain.get_ColIndex(gstrCOL_KEY_NAME)).Filter.GetEditor()
    
    Private Sub ResizeFilterWindow()
    
        On Error GoTo VB_Error
    
        For Each frm As Form In Application.OpenForms
    
            If frm.Name = "FilterEditorForm" AndAlso frm.GetType().ToString() = "C1.Win.C1FlexGrid.FilterEditorForm" Then
    
                mfrmFilterForm = frm
    
                AddHandler frm.FormClosing, AddressOf Frm_FormClosing
                AddHandler CType(frm.Controls(0), ToolStrip).ItemClicked, AddressOf Frm_ItemClicked
                frm.Controls.RemoveAt(1)
    
                Dim c1List1 As C1.Win.C1List.C1List = New C1.Win.C1List.C1List()
                frm.Controls.Add(c1List1)
                c1List1.Caption = ""
                c1List1.Dock = DockStyle.Fill
                c1List1.ShowHeaderCheckBox = True
                c1List1.SelectionMode = C1.Win.C1List.SelectionModeEnum.CheckBox
                c1List1.DataMode = C1.Win.C1List.DataModeEnum.AddItem
                c1List1.ExtendRightColumn = True
                c1List1.ItemHeight = 24
                c1List1.Style.VerticalAlignment = C1.Win.C1List.AlignVertEnum.Center
    
                c1List1.Columns.Add(New C1.Win.C1List.C1DataColumn())
                c1List1.Columns(0).Caption = "(Select All)"
    
                c1List1.AddItem("")
                c1List1.AddItem(gstrCOL_KEY_FILE_SAVED)
    
                c1List1.Columns(0).ValueItems.Values.Add(New C1.Win.C1List.ValueItem("", ""))
                c1List1.Columns(0).ValueItems.Values.Add(New C1.Win.C1List.ValueItem(gstrCOL_KEY_FILE_SAVED, Me.imlIconsSmall.Images.Item(gstrICON_ITEM_FILE_SAVED)))
                c1List1.Columns(0).ValueItems.Translate = True
    
                Dim obj As Object
                Dim cf = flxMain.ColumnCollection.Item(flxMain.ColumnCollection.IndexOf(gstrCOL_KEY_FILE_SAVED))
                If (cf.Filter.IsActive) Then
                    For Each obj In (CType(cf.Filter, ValueFilter)).ShowValues
                        If (obj IsNot Nothing) Then
                            Dim rowIndex = c1List1.FindStringExact(obj.ToString(), 0)
                            c1List1.SelectedIndices.Add(rowIndex)
                        End If
                    Next
    
                End If
                Exit For
    
            End If
    
        Next
    
        Exit Sub
    

    VB_Error:

        Call gReportError(gstrVBUnexpectedErrorText("ResizeFilterWindow"), MsgBoxStyle.Critical, Me.Text, Err.Number)
    
    End Sub
    
    Private Sub Frm_FormClosing(sender As Object, e As FormClosingEventArgs)
    
        Dim iSelectedLoop As Integer
    
        On Error GoTo VB_Error
    
        Dim cf = flxMain.ColumnCollection.Item(flxMain.ColumnCollection.IndexOf(gstrCOL_KEY_FILE_SAVED))
    
        If mstrFilterActionString = "Apply" Then
            Dim lst = CType(mfrmFilterForm.Controls(1), C1.Win.C1List.C1List)
    
            Dim selList = New List(Of Object)
            For iSelectedLoop = 0 To lst.SelectedIndices.Count - 1
                Dim rowIndex = lst.SelectedIndices(iSelectedLoop)
                selList.Add(lst.Columns(0).CellValue(rowIndex))
            Next
    
            cf = flxMain.ColumnCollection.Item(flxMain.ColumnCollection.IndexOf(gstrCOL_KEY_FILE_SAVED))
    
            Dim vFilter = New ValueFilter()
            vFilter.ShowValues = selList.ToArray()
            cf.Filter = vFilter
    
        ElseIf mstrFilterActionString = "Clear" Then
            cf.Filter = Nothing
        End If
    
        Exit Sub
    

    VB_Error:

        Call gReportError(gstrVBUnexpectedErrorText("Frm_FormClosing"), MsgBoxStyle.Critical, Me.Text, Err.Number)
    
    End Sub
    

    So gstrICON_ITEM_FILE_SAVED is only mentioned when extracting the ImageList value. I also tried changing this constant to FileSaved but then the blank filter stops working as well

    Thanks

    Martin

  • Posted 8 November 2018, 4:03 am EST

    Martin,

    Can you see the icons in your unfiltered grid? Also, please tell me the value you see when you go into edit mode of a cell that has the icons you want to be filtered.

    Thanks.

  • Posted 8 November 2018, 8:01 pm EST - Updated 3 October 2022, 4:46 pm EST

    Jitender,

    I enabled AllowEditing and when I double click the icon cell the cell is empty. See the before and after images:

    This is the code that populates the grid:

                With vobjflxGrid
    
                    .BeginUpdate()
    
                    .Rows = rudtWork.colListRows.Count + .FixedRows
                    intGridRow = .FixedRows - 1
    
                    'build list
                    For Each objListRow In rudtWork.colListRows
    
                        'Initialise strIcon to non-Swift (46014)
                        strIcon = gstrICON_ITEM_FILE_BLUE
                        If gblnIsInCollection(objListRow.gcolListRowFields, gstrCOL_KEY_SWIFT_MSG_TYPE) Then
                            If Trim(objListRow.gcolListRowFields.Item(gstrCOL_KEY_SWIFT_MSG_TYPE).gvntValue) <> "" Then
                                'It's a Swift message.... (46014)
                                strIcon = gstrICON_ITEM_FILE
                                '....but it might be from a Data Vendor (46014)
                                lngIx = gintGetContactIndex("", objListRow.gcolListRowFields.Item(gstrCOL_KEY_SENDER).gvntValue, gudtContacts, modClientDbSystem.gCONTACTS_BY_ENUM.gintContactsBySendCode)
                                If lngIx = -1 Then
                                    'Didn't find full SendCode on Contacts, try for first 8 characters (46014)
                                    lngIx = gintGetContactIndex("", Left(objListRow.gcolListRowFields.Item(gstrCOL_KEY_SENDER).gvntValue, 8), gudtContacts, modClientDbSystem.gCONTACTS_BY_ENUM.gintContactsBySendCode)
                                End If
                                If lngIx > -1 Then
                                    If gudtContacts.audtContact(lngIx).strRoleType = gstrPICKLIST_CONTACT_ROLE_TYPE_DATAVENDOR Then
                                        strIcon = gstrICON_ITEM_WORK_DATAVENDOR
                                    End If
                                End If
                            End If
                        End If
    
                        intGridRow += 1
                        .set_TextMatrix(intGridRow, 0, objListRow.gcolListRowFields.Item(rudtNewColumns.audtColumn(0).strKey).gvntValue)
                        .set_Cell(CellPropertySettings.flexcpPicture, intGridRow, 0, vobjListView.SmallImageList.Images.Item(strIcon))
    
                        For lngIx = 1 To rudtNewColumns.lngColumnCount - 1
                            If gblnIsInCollection(objListRow.gcolListRowFields, rudtNewColumns.audtColumn(lngIx).strKey) Then
    
                                Select Case rudtNewColumns.audtColumn(lngIx).strKey
    
                                    Case gstrCOL_KEY_FILE_DATE, gstrCOL_KEY_DATE, gstrCOL_KEY_DATE_RDDT, _
                                         gstrCOL_KEY_DATE_XDTE, gstrCOL_KEY_DATE_EFFD, gstrCOL_KEY_DATE_PAYD
                                        ' Stop an empty date showing as 01/01/0001
                                        If objListRow.gcolListRowFields.Item(rudtColumns.audtColumn(lngIx).strKey).gvntValue = "" Then
                                            .set_Cell(CellPropertySettings.flexcpPicture, intGridRow, lngIx, vobjListView.SmallImageList.Images.Item(gstrICON_BLANK))
                                        Else
                                            .set_TextMatrix(intGridRow, lngIx, objListRow.gcolListRowFields.Item(rudtColumns.audtColumn(lngIx).strKey).gvntValue)
                                        End If
    
                                    Case Else
                                        If rudtNewColumns.audtColumn(lngIx).strKey = gstrCOL_KEY_FILE_SAVED AndAlso IsDate(objListRow.gcolListRowFields.Item(gstrCOL_KEY_FILE_SAVED_DATE).gvntValue) Then
                                            .set_Cell(CellPropertySettings.flexcpPicture, intGridRow, lngIx, vobjListView.SmallImageList.Images.Item(gstrICON_ITEM_FILE_SAVED))
                                        Else
                                            .set_TextMatrix(intGridRow, lngIx, CStr(objListRow.gcolListRowFields.Item(rudtColumns.audtColumn(lngIx).strKey).gvntValue))
                                        End If
    
                                End Select
                            End If
                        Next lngIx
    
                    Next
    
                    CType(vobjflxGrid, C1FlexGrid).Sort(New clsComparerFlexGrid(intSortColumn, If(intSortMode.Equals(SortFlags.Ascending), True, False)))
                    .ShowSortAt(intSortMode, intSortColumn)
                    .ShowSortPosition = ShowSortPositionEnum.Right
    
                    .EndUpdate()
    
                End With
    

    So is this line wrong in how it is assigning the ImageList icon in the first place?

    .set_Cell(CellPropertySettings.flexcpPicture, intGridRow, lngIx, vobjListView.SmallImageList.Images.Item(gstrICON_ITEM_FILE_SAVED))

    Thanks

    Martin

  • Posted 8 November 2018, 8:25 pm EST

    Jitender,

    Also if we had the latest version of the flexgrid would this be easier to do or inherently supported without the need to use Lists etc i.e. not having to write extra code to do this - is this functionality just something that works in the latest release?

    Thanks

    Martin

  • Posted 8 November 2018, 9:01 pm EST

    Hi Martin,

    No, you would still need to do this manually, the default filter list can only display text values.

    You’re directly setting image to the cell that’s why the cell has no value (null value). This is the reason filtering icons is not working. Filtering is done on values, so when you filter by icon it compares the icon’s key (gstrICON_ITEM_FILE_SAVED) with the underlying value (which is currently null).

    To make it work, you would need to assign a value (gstrICON_ITEM_FILE_SAVED) to the cells with icon, and leave empty value for other cells.

    The icons would be automatically set using the imageMap you’ve already assigned to the column.

    Hope it helps you resolve your issue. Let me know how it goes.

    Regards,

    Jitender

  • Posted 8 November 2018, 11:03 pm EST

    Jitender,

    I’ve dropped the imagelist into the project you provided and changes the code:

        Dim imageMap = New Dictionary(Of String, Image)
        'imageMap.Add("Important", Image.FromFile("..\..\Images\Important_16x.png"))
        imageMap.Add("Important", Me.imlIconsSmall.Images.Item("ItemFileSaved"))
    
                'c1List1.Columns(0).ValueItems.Values.Add(New C1.Win.C1List.ValueItem("Important", Image.FromFile("..\..\Images\Important_16x.png")))
                c1List1.Columns(0).ValueItems.Values.Add(New C1.Win.C1List.ValueItem("Important", Me.imlIconsSmall.Images.Item("ItemFileSaved")))
    

    It works…

    Thanks

    Martin

  • Posted 9 November 2018, 1:29 am EST

    Jitender,

    Ok now i understand how: I set the value to gstrCOL_KEY_FILE_SAVED after assigning the column an ImageMap and it works!!!

    Thanks for all your efforts…

    Regards

    Martin

  • Posted 11 November 2018, 7:08 pm EST

    Jitender,

    Since I added your code I get an evaluation screen appearing. So adding the C1list as a reference to the project and using it within your code raises this evaluation screen.

    A colleague of mine will have registered the like of the Flexgrid etc over 10 years ago! When I click the about on the Flexgrid there is no means on entering a license so how do I register the C1List as it has no control to click?

    Surely we bought the C1 suite and all components were registered?

    We are looking to upgrade to the latest suite as we would like the functionality of the calendar in the filter window but that process of paying the upgrade etc is for the future

    So for now how do I get rid of the C1list evaluation nag screen as the other existing C1 controls we use are registered…

    Regards

    Martin

  • Posted 12 November 2018, 4:39 pm EST

    Hi Martin,

    For our Winforms controls, there are two parts to the licensing model. The first is the activation of a serial key on the local dev machine. This is accomplished via the C1LicenseActivation utility. The second is licensing the control inside your application. For this we use the Visual Studio model and the licenses.licx.

    If you have already activated your key, it sounds like the issue may be with the second part. The entry of every C1 control used in your project at design time or at run time should be present in the licenses.licx file of the project. Otherwise, the nag screen is likely to appear. Please add the following entry in the licenses.licx file of this project, save and rebuild the solution:

    C1.Win.C1List.C1List, C1.Win.C1List.4
    

    The problem should no longer occur.

    If it does for any other control in future, I would suggest to drag and drop every C1 control (used in your project) on any Form in your application. This would automatically generate the corresponding entries in the licenses.licx file. You can later remove these controls from the Form.

    In addition to this, I will suggest you to go through the following blog articles for more information on how to resolve licensing problems:

    http://our.componentone.com/2016/01/25/licensing-and-licenses-licx-file-licxgenerator-tool/

    http://our.componentone.com/2013/02/01/licensing-problems-the-licenses-licx-file-and-you/

    Thanks,

    Pragati

  • Posted 11 December 2018, 2:22 am EST

    Jitender,

    Thanks for all you previous help in getting the icons placed into the filter window.

    Unfortunately the user has started testing the use of the grid in earnest with icon filtering and found a few problems.

    1. Is there a way to show the icon without the intermediate step of showing values Blank and Column name of interest e.g. UserAlert

    2. If the user has applied an icon filter then she cannot easily clear it. When she clicks on the filter icon in the column header the filter appears then disappears immediately. The only way you can clear the filter is to click and hold down the mouse move it into the filter window and click Clear.

    She doesn’t think this is good enough for a production system.

    Thanks

    Martin

  • Posted 11 December 2018, 10:39 pm EST

    Hi Martin,

    1. Since the grid cannot compare icons, it is necessary to have an underlying value, so that the grid can compare those values.

    2. This should not happen. I’ve attached a video demonstrating the behavior I observed while executing my earlier sample. Can you please see if you face the issue of clearing filter in that sample?

    Thanks,

    Jitender

    FilterIcon_Video.zip

  • Posted 11 December 2018, 11:39 pm EST

    Jitender,

    Thanks for the reply.

    I’ve noticed a few things:

    1. Your video didn’t show the underlying text of the sample program being shown prior to the icon being shown. When i run the sample program I do see the text if only briefly. I’m on a pretty fast PC so it maybe down to the version of flexgrid (2.0.20153.102). I did change the sample slightly - changed the icon used. I’ve attached my sample. If you do not get the text briefly before the icon loads then it must be the version of flexgrid i’m using?

    FilterIconList.zip

    1. I have found I was missing two lines that seem to have fixed this problem:

                       .ColumnCollection.Item(.ColumnCollection.IndexOf(gstrCOL_KEY_CONFRECEIVED)).DataType = GetType(String)
                       .ColumnCollection.Item(.ColumnCollection.IndexOf(gstrCOL_KEY_CONFRECEIVED)).AllowEditing = False
      

    Thanks

    Martin

  • Posted 16 December 2018, 8:40 pm EST

    Hi Martin,

    1. It’s not because of FlexGrid version. I can observe it now. Apparently, the default filter form is displayed on as soon as Mouse is pressed. In my earlier sample, the modified form was displayed on MouseClick event (which is MouseDown THEN MouseUp). So, until Mouse button is released, the underlying text was visible.

    To avoid this, I would suggest you to use MouseDown event instead of MouseClick.

    I’ve also modified the sample. Let me know if you still observe the underlying values in the filter.

    FilterIconList_Modified.zip

    1. [quote=“martin.teefy”]

      I have found I was missing two lines that seem to have fixed this problem:

    .ColumnCollection.Item(.ColumnCollection.IndexOf(gstrCOL_KEY_CONFRECEIVED)).DataType = GetType(String)

    .ColumnCollection.Item(.ColumnCollection.IndexOf(gstrCOL_KEY_CONFRECEIVED)).AllowEditing = False

    [/quote]

    Can you explain which problem are you referring to here?

    Thanks,

    Jitender

Need extra support?

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

Learn More

Forum Channels