This is a migrated thread and some comments may be shown as answers.

Filter on Enter not working after upgrading to 2008.3.1312.35

9 Answers 235 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mkasuboski
Top achievements
Rank 1
mkasuboski asked on 14 Jan 2009, 09:42 PM
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:
        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!


9 Answers, 1 is accepted

Sort by
0
mkasuboski
Top achievements
Rank 1
answered on 15 Jan 2009, 01:44 PM
I just wanted to push this post back to the top since it is impacting any future deployments we have for our websites.

Thanks!
0
Rosen
Telerik team
answered on 16 Jan 2009, 09:14 AM
Hello mkasuboski,

The behavior you are experiencing is due to the introduction of Column's FilterTemplate functionality. Thus your custom code should be modified in order to function correctly with this grid feature. I have attached a sample page which demonstrates the necessary changes.

Also please note that there was an issue with client-side filter function, which was addressed by our developers. That is why the archive contains a trial version of the latest internal build (you may open a formal support ticket for the dev version or check when it is available in latest internal build section of your account).

We updated your Telerik points for drawing our attention to these details.

Best regards,
Rosen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
mkasuboski
Top achievements
Rank 1
answered on 16 Jan 2009, 01:53 PM
Okay, I only saw one difference in your attached code sample and my current code sample, and I don't see how this will fix the issue.
The difference is only 1 line in the client side code in the filterOnEnter function.

Here is my line of code:
tableView.filter(col, query, filter); 

Here is your line of code from the attached sample:
tableView.filter(col,query,1); 

All you did was hard code a filter option, instead of letting the prior code in the function determine the filter option.  I really don't see how this will correct the issue I am having.

In the rest of your email, are you telling me that there is a newer version (trial) of the DLL that WILL fix my issue, or that it addressed client side filtering issue and you really don't know if it will fix the issue?
What version is this new DLL, and what code changes will I need to make when using this new DLL?





0
Accepted
Rosen
Telerik team
answered on 16 Jan 2009, 03:03 PM
Hi mkasuboski,

I'm sorry about the confusion.

The actual line that need to be changed is this:
txt.Attributes("onkeydown") = "filterOnEnter(this, event, '" & RadGrid1.ClientID & "', '" & colName & "')" 
This will override the onkeydown function which is added to the textbox control.

As to the mentioned version of the dll (attached previously):
It addresses the client-side filtering function issue which will throw a js error if a Telerik.Web.UI.GridFilterFunction enum value if passed instead of an GridFilterFunction's string representation.

Best regards,
Rosen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
mkasuboski
Top achievements
Rank 1
answered on 16 Jan 2009, 07:02 PM
This DLL version, 2008.3.1316.35 and suggested code-behind change corrected the issue of 'Filter on Enter' for the RadGrid.

Thanks!
0
Kev
Top achievements
Rank 1
answered on 09 Mar 2009, 05:03 PM
Hi, i have implemented the fix recommended here but it only part fixed the problem...  It worked on the first page load the first time I  filteedr, but when i cleared the search and tried again, i just got the filter menu pop where ever my mouse pointer was.  I have got my grid inside a ascx control and this uses standard AJAX update panel to prevent the postback.  Any ideas?? Thanks Kev
0
Henrik
Top achievements
Rank 1
answered on 12 Mar 2009, 09:24 AM
On the previous version, I did not implement any special code to apply the filter when enter was hit. After upgrading, no filter is applied when enter is hit. Do I need to implement some special code to make it work?

/Henrik
0
Sebastian
Telerik team
answered on 12 Mar 2009, 09:39 AM
Hello Henrik,

Can you please check whether the issue you depicted appears with the latest internal build available for download from your account? You can also migrate to the Q1 2009 official release of our controls which is expected to be announced later today.

Best regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Henrik
Top achievements
Rank 1
answered on 24 Mar 2009, 01:53 PM
Hi Sebastian,

The bug is fixed in the Q1 2009 official release version.

Best regards,

Henrik
Tags
Grid
Asked by
mkasuboski
Top achievements
Rank 1
Answers by
mkasuboski
Top achievements
Rank 1
Rosen
Telerik team
Kev
Top achievements
Rank 1
Henrik
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or