I just upgraded my Telerik.dll to 2008.3.1312.35 and my filter on enter seems to have quit working.
I have this code in the code-behind for the ItemCreated event:
And this javascript in the HTML:
The application is still working on my development and production machine, but only because I have not upgraded the Telerik.dll yet. The web page with the above code has not been modified since deployment to both the development and production environments.
Thanks!
I have this code in the code-behind for the ItemCreated event:
| If e.Item.ItemType = GridItemType.FilteringItem Then |
| Dim filterItem As GridFilteringItem = e.Item |
| For Each col As GridColumn In rgSelectCustNo.MasterTableView.RenderColumns |
| If col.UniqueName = "ExpandColumn" Or col.UniqueName = "RowIndicator" Then |
| Continue For |
| Else |
| Dim colName As String = col.UniqueName |
| Dim txt As TextBox = CType(filterItem(colName).Controls(0), TextBox) |
| If Not txt Is Nothing Then |
| txt.Attributes.Add("onkeypress", "filterOnEnter(this, event, '" & rgSelectCustNo.ClientID & "', '" & colName & "')") |
| End If |
| End If |
| Next |
| End If |
And this javascript in the HTML:
| var cancelFilterMenu = false; |
| var tableView = null; |
| function filterOnEnter(sender, e, gridId, col) { |
| if (e.keyCode == 13) { |
| cancelFilterMenu = true; |
| if (tableView == null) { |
| tableView = $find(gridId).get_masterTableView(); |
| } |
| var filter = Telerik.Web.UI.GridFilterFunction.Contains |
| var query = sender.value; |
| if (query.endsWith('*') && query.startsWith('*')) { |
| filter = Telerik.Web.UI.GridFilterFunction.Contains; |
| query = query.substr(1, query.length - 2); |
| } else if (query.endsWith('*')) { |
| filter = Telerik.Web.UI.GridFilterFunction.StartsWith; |
| query = query.substr(0, query.length - 1); |
| } |
| tableView.filter(col, query, filter); |
| } |
| } |
The application is still working on my development and production machine, but only because I have not upgraded the Telerik.dll yet. The web page with the above code has not been modified since deployment to both the development and production environments.
Thanks!