Hi,
I am applying a filter to my grid on a hidden column using a form buttons click event (see code below). When I click the button again I want to remove filtering, but only for that particular column i.e. if filtering is already on another column don't reset all filters...
I've tried using Me.DgvInvoiceData.FilterDescriptors.Remove(filter) but the grid stay the same...
Any ideas?
Dim filter As New FilterDescriptor()
filter.PropertyName = "Custom"
filter.[Operator] = FilterOperator.IsEqualTo
filter.Value = "Yes"
filter.IsFilterEditor = True
If btnCustom.Text = "Show Only Custom Lines" Then
Me.DgvInvoiceData.FilterDescriptors.Add(filter)
btnCustom.Text = "Show All Lines Including Custom"
Else
MsgBox("Clearing filter")
Me.DgvInvoiceData.FilterDescriptors.Remove(filter)
btnCustom.Text = "Show Only Custom Lines"
Me.DgvInvoiceData.Refresh()
End If
Thanks...
I am applying a filter to my grid on a hidden column using a form buttons click event (see code below). When I click the button again I want to remove filtering, but only for that particular column i.e. if filtering is already on another column don't reset all filters...
I've tried using Me.DgvInvoiceData.FilterDescriptors.Remove(filter) but the grid stay the same...
Any ideas?
Dim filter As New FilterDescriptor()
filter.PropertyName = "Custom"
filter.[Operator] = FilterOperator.IsEqualTo
filter.Value = "Yes"
filter.IsFilterEditor = True
If btnCustom.Text = "Show Only Custom Lines" Then
Me.DgvInvoiceData.FilterDescriptors.Add(filter)
btnCustom.Text = "Show All Lines Including Custom"
Else
MsgBox("Clearing filter")
Me.DgvInvoiceData.FilterDescriptors.Remove(filter)
btnCustom.Text = "Show Only Custom Lines"
Me.DgvInvoiceData.Refresh()
End If
Thanks...