Yes, the OnModuleCommunication event looks llike this:
Public Sub OnModuleCommunication(ByVal s As Object, ByVal e As Entities.Modules.Communications.ModuleCommunicationEventArgs) Implements Entities.Modules.Communications.IModuleListener.OnModuleCommunication
If e.Target = CStr(Me.ModuleId) Then
Session("UDT_" & e.Target & "_Filter") = e.Text
BindData()
End If
End Sub
and then I've added a codeline in the GetRowFilter Function :
Private Function GetRowFilter(ByVal Filter As String, ByVal Search As String) As String
' Added by Martin Moesby Petersen to support "Userdefined Filtering"
Filter = CStr(Session("UDT_" & CStr(Me.ModuleId) & "_Filter"))
' Martin Moesby Petersen - END
Dim tr As TokenReplace = TokenReplace.Create(ModuleConfiguration)
If Filter <> String.Empty Then.
Filter = tr.ReplaceEnvironmentTokens(Filter)
End If
If Filter <> String.Empty AndAlso Search <> String.Empty Then
Return "(" & Filter & ") AND (" & Search & ")"
Else
Return Filter & Search
End If
End Function
I've done that because that required the least modifikation to the module code and it's a function that's called in all Binding-functions.
ANd when debugging, the datatview object in the Binding-functions shows the correct amount om entries to be shown...
' create a dataview to process the sort
Dim dv As DataView = New DataView(DataSet.Tables(DataSetTableName.Data))
Try
Dim strFilter As String = GetRowFilter(CStrN(Settings(SettingName.Filter), ""), search.Filter)
dv.RowFilter = strFilter '<---- this one sets the correct filter
So, basically, the UDT has the correct amount of entries, but it wont update? Only when pressing F5 in the Browser, the filter kicks in, and filters the data correctly.
If needed, I can uload the current version of the module to a demo site, so you can see your self, what the issue is...
Thx,
Martin