Filter drop down error

Posted by: milosic.bogdan on 14 June 2018, 8:45 am EST

    • Post Options:
    • Link

    Posted 14 June 2018, 8:45 am EST - Updated 4 October 2022, 2:06 am EST

    I made one application while ago where i use filter drop down. On some computers users get error when just clicking on arrow…

    Any idea what to do?

  • Posted 15 June 2018, 2:32 am EST

    Hi Bogdan!

    Without looking into the code, this is hard to comment on this odd behaviour. Attached is a small application that works fine at my end.

    Can you modify this to replicate the issue? Also, please share environment details and build version of C1 control of those users’ machines on which this issue is being observed.

    Prj_FilterEditorFormInTDB.zip

    Best regards,

    Meenakshi

  • Posted 22 June 2018, 1:45 am EST

    Hi

    Problem is that on my side everything works ok.

    I cannot acces to other computers, i just get screenshot with this error.

    Operating system on other computers are Windows 7 Pro 64, application is deployed via click once publish, not classic setup.

    Reference for grid is C1.Win.C1TrueDBGrid.4, version 4.0.20181.296, specific version = false

    Is there any reference required for grid filter drop down?

  • Posted 25 June 2018, 1:42 am EST

    Hi!

    Is there any reference required for grid filter drop down?

    • No. There is no other reference required for this.

    However, I request you to see the previously shared sample “Prj_FilterEditorFormInTDB.zip” and let me know if this is exactly how you are showing filter drop-down in your application. If there is any different way in which filter drop-down is displayed in your app, you can tell me that as well.

    Also, share stack trace for this error, that might be helpful in further investigation of this case.

    Regards,

    Meenakshi

  • Posted 3 July 2018, 7:25 am EST - Updated 4 October 2022, 2:06 am EST

    Hi

    I use visual basic as language, and also custom filter bar

    
    
     Private Sub tdgPlan_AfterFilter(sender As Object, e As C1.Win.C1TrueDBGrid.FilterEventArgs) Handles tdgPlan.AfterFilter
            For i As Integer = 0 To tdgPlan.Splits(0).Rows.Count - 1
    
                tdgPlan.Splits(0).Rows(i).AutoSize()
    
                If tdgPlan.Splits(0).Rows(i).Height < 22 Then
                    tdgPlan.Splits(0).Rows(i).Height = 22
                End If
            Next
            tdgPlan.ResumeLayout(True)
    
            fillFilter()
    
        End Sub
    
        Private Sub tdgPlan_AfterSort(sender As Object, e As C1.Win.C1TrueDBGrid.FilterEventArgs) Handles tdgPlan.AfterSort
            For i As Integer = 0 To tdgPlan.Splits(0).Rows.Count - 1
    
                tdgPlan.Splits(0).Rows(i).AutoSize()
    
                If tdgPlan.Splits(0).Rows(i).Height < 22 Then
                    tdgPlan.Splits(0).Rows(i).Height = 22
                End If
            Next
            tdgPlan.ResumeLayout(True)
    
            fillFilter()
        End Sub
    
        Private Sub C1TrueDBGrid1_FilterChange(ByVal sender As Object, ByVal e As System.EventArgs) Handles tdgPlan.FilterChange
            Try
    
    
                ' Build our filter expression.
                Dim sb As New System.Text.StringBuilder()
                Dim dc As C1.Win.C1TrueDBGrid.C1DataColumn
                For Each dc In Me.tdgPlan.Columns
                    If dc.FilterText.Length > 0 Then
                        If sb.Length > 0 Then
                            sb.Append(" AND ")
                        End If
                        'sb.Append((dc.DataField + " like " + "'" + dc.FilterText + "*'"))
    
                        If dc.DataField = "DESCRIPTION" Then
    
                            sb.Append((dc.DataField + " like " + "'%" + dc.FilterText + "%'"))
    
                        ElseIf dc.DataField = "FACTORY_CODE" Then
    
                            sb.Append((dc.DataField + " like " + "'%" + dc.FilterText + "%'"))
    
                        ElseIf dc.DataField = "D1" Then
    
                            sb.Append((dc.DataField + " like " + "'%" + dc.FilterText + "%'"))
    
                        ElseIf dc.DataField = "D2" Then
    
                            sb.Append((dc.DataField + " like " + "'%" + dc.FilterText + "%'"))
    
                        ElseIf dc.DataField = "D3" Then
    
                            sb.Append((dc.DataField + " like " + "'%" + dc.FilterText + "%'"))
    
                        Else
    
                            If dc.FilterText.Contains(">") Then
                                sb.Append((dc.DataField + " > " + "'" + Replace(dc.FilterText, ">", "") + "'"))
                            ElseIf dc.FilterText.Contains("<") Then
                                sb.Append((dc.DataField + " < " + "'" + Replace(dc.FilterText, "<", "") + "'"))
                            ElseIf dc.FilterText.Contains("null") Then
                                sb.Append((dc.DataField + " is null"))
                            ElseIf dc.FilterText.Contains("True") Then
                                sb.Append((dc.DataField & " = " & 1))
                            ElseIf dc.FilterText.Contains("False") Then
                                sb.Append((dc.DataField & " = " & 0))
                            Else
                                sb.Append((dc.DataField + " = " + "'" + dc.FilterText + "'"))
                            End If
    
                        End If
    
    
                    End If
                Next dc
                ' Filter the data.
    
                Dim str As String = sb.ToString()
                dt.DefaultView.RowFilter = str
    
                For i As Integer = 0 To tdgPlan.Splits(0).Rows.Count - 1
    
                    tdgPlan.Splits(0).Rows(i).AutoSize()
    
                    If tdgPlan.Splits(0).Rows(i).Height < 22 Then
                        tdgPlan.Splits(0).Rows(i).Height = 22
                    End If
                Next
                tdgPlan.ResumeLayout(True)
    
                fillFilter()
    
            Catch ex As Exception
    
            End Try
        End Sub
    
    
    

    on load:

    
    
    tdgPlan.FilterBar = True
                ' we'll do the filtering ourselves
                tdgPlan.AllowFilter = False
    
                'tdgPlan.Columns("RECEIVED_DATE").NumberFormat = dateformat & " " & timeformat '"dd.MM.yy HH:mm" 'dateformat & " " & timeformat
                tdgPlan.Columns("LAST_TEST_DATE").NumberFormat = dateformat
                'tdgPlan.Columns("ORDER_END").NumberFormat = dateformat
    
                'tdgPlan.Columns("QTY_1").NumberFormat = "#,##0"
    
                txtLeto.Text = Today.Year
                txtQuartal.Text = GetQuartalFromMonth(Today.Month)
    
          
                My.Application.DoEvents()
                RefreshGrid()
    
    
    

    refresh grid

    
    
    dt = GetDataTableBySQL(strsql)
    
                getAditionalData(dt, first_month_start, first_month_end, second_month_start, second_month_end, third_month_start, third_month_end)
    
                Me.tdgPlan.SetDataBinding(dt, "", True)
    
                For i As Integer = 0 To tdgPlan.Splits(0).Rows.Count - 1
    
                    tdgPlan.Splits(0).Rows(i).AutoSize()
    
                    If tdgPlan.Splits(0).Rows(i).Height < 22 Then
                        tdgPlan.Splits(0).Rows(i).Height = 22
                    End If
                Next
                tdgPlan.ResumeLayout(True)
    
    
    

    i Also received update from users:

    When user click Continue or quit

    When they click ok, aplication closes down.

  • Posted 4 July 2018, 4:42 am EST - Updated 4 October 2022, 2:06 am EST

    Hi

    Thanks, but if you could share stack trace of that exception also then it might be more helpful for us in finding its cause and solution.

    Kindly ask your user(s) to expand Details section when they see the exception :

    This will show the stack trace to them.

    Thanks,

    Meenakshi

  • Posted 5 July 2018, 2:35 am EST

    I get answer from users that in any case same message is displayed…

    Dont know how this is even possible?

  • Posted 6 July 2018, 12:40 am EST - Updated 4 October 2022, 2:06 am EST

    In order to investigate the cause and resolution, stack trace is required. I am writing down the steps to see stack trace, for your users :

    1. Exception is thrown and this error screen is displayed -

    2. Now, the user needs to click on Details button. It will show some additional text which was previously hidden.

      Kindly copy that text and save it in a Notepad file. Next, you can share that get that file from any of your users.

    Regards,

    Meenakshi

  • Posted 6 July 2018, 1:48 am EST - Updated 4 October 2022, 2:06 am EST

    As i answered above, when user click on details, message is displayed:

    Maybe because is dropdown, same as in grid??

    And when user click OK, application end itself.

  • Posted 9 July 2018, 1:50 am EST

    Let me discuss this with the development team. I’ll update you soon, with the results.

    Regards,

    Meenakshi

  • Posted 31 July 2018, 7:46 am EST

    Hi, any update on this object?

  • Posted 31 July 2018, 11:30 pm EST

    Hi Bogdan!

    This issue is still with the development team only; I’ll notify you once there is any update from them.

    Best regards,

    Meenakshi

  • Posted 1 August 2018, 5:06 am EST

    Is there any option that some refernces are in conflict?

    adding sub:

     Private Sub tdgPlan_FilterButtonClick(sender As Object, e As ColEventArgs) Handles tdgPlan.FilterButtonClick
    
        End Sub
    

    automaticly add imports

    Imports C1.Win.C1TrueDBGrid
    

    but i i delete imports VS suggest me two options:

    Imports C1.Win.C1TrueDBGrid
    

    or

    Imports C1.Win.C1List
    

    I also use C1.Win.C1List.C1Combo (but not on problematic form)!

  • Posted 1 August 2018, 5:22 am EST

    Hi Bogdan.

    Can you show the source code of the fillFilter() method?

    Do you use the C1Input controls in a custom filter?

  • Posted 1 August 2018, 6:22 am EST

    Here i have wrong name:) for this method:

    
     Private Sub fillFilter()
            Try
                tdgPlan.Columns("DESCRIPTION").FooterText = "Nr. all = " & tdgPlan.RowCount
            Catch ex As Exception
                tdgPlan.Columns("DESCRIPTION").FooterText = ""
            End Try
        End Sub
    
    
  • Posted 1 August 2018, 6:35 am EST

    On form only component from C1 is C1trueDbGrid - tdgPlan, on column is FilterDropdown set to True

  • Posted 6 August 2018, 1:45 am EST

    Hi Bogdan,

    The developers are currently investigating this further. Will update the thread once it is done.

    ~Pragati

  • Posted 8 October 2018, 4:16 am EST

    Error is still present, any progress in finding solution?

  • Posted 9 October 2018, 12:45 am EST

    Hi

    Can you please confirm, if you are still facing the same issue with our latest C1 builds of 2018v2?

    [Download these builds for testing, from here: http://prerelease.componentone.com/dotnet40/c1winforms/2018-t2/C1WinForms.4_4.0.20182.320.zip]

    • Meenakshi
Need extra support?

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

Learn More

Forum Channels