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

Filtering in hyperlinks

5 Answers 166 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Debashis Pyne
Top achievements
Rank 1
Debashis Pyne asked on 01 Nov 2010, 02:52 PM
Hi,

We have a hyperlink in the radgrid and unfortunately the filtering doesn't work.
The following ASPX code have been used:

<telerik:GridHyperLinkColumn HeaderText = "Discussion Name" DataTextField="Discussion_Name"
ItemStyle-HorizontalAlign="Left" UniqueName="Discussion_Name"
DataNavigateUrlFields="Discussion_Id" SortExpression="Discussion_Name" ItemStyle-Width="320"
DataNavigateUrlFormatString="Observation.aspx?Id={0}">
</telerik:GridHyperLinkColumn>

Any ideas why is this?

Thanks!

5 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 01 Nov 2010, 04:31 PM
Hello Debashis,

In order the GridHyperLinkColumn filtering to work properly, you need to set the DataTextField as you already did. Can you elaborate on what happens when you try to filter it? You can add a GridBoundColumn with DataField the same you are using for the DataTextField for the GridHyperLinkColumn and see if it gives you the desired results upon filtering and if they are different.

Kind regards,
Iana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jay Leffue
Top achievements
Rank 1
answered on 16 Dec 2010, 03:34 PM
Same issue:

<telerik:GridHyperLinkColumn SortExpression="Title" DataTextField="Title" DataNavigateUrlFields="ID" UniqueName="Title" DataNavigateUrlFormatString="~/Page.aspx?id={0}" HeaderText="Title"
        CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true" >
        </telerik:GridHyperLinkColumn>

I can filter on all the other columns fine.  They all work where I type a search parameter and hit enter.  This then filters.  When I hit enter on the HyperLinkColumn I get nothing.

Watching the Error Console I get this when I hit enter on a Hyper Link Column:

Error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near '

<!DOCTYPE html P'.
Source File: http://localhost:1583/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a3de828f0-5e0d-4c7d-a36b-56a9773c0def%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2010.3.1109.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a62e881c6-518e-447d-b6e7-1af83cb2d164%3ae330518b%3a16e4e7cd%3af7645509%3a24ee1bba%3a1e771326%3ac8618e41%3af46195d3%3aaa288e2d%3a58366029%3ae4f8f289%3a874f8ea2%3a19620875%3a490a9d4e%3abd8f85e4%3aed16cbdc
Line: 15
0
Princy
Top achievements
Rank 2
answered on 17 Dec 2010, 07:18 AM
Hello Jay,

GridHyperLinkColumn filter on it's DataTextField and you should also have to set DataType in order to have correct filter working.

ASPX:
<telerik:GridHyperLinkColumn SortExpression="Title" DataTextField="Title"
   DataNavigateUrlFields="ID" UniqueName="Title"
   DataNavigateUrlFormatString="~/Page.aspx?id={0}" HeaderText="Title"
   CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true"
   DataType="System.String">
</telerik:GridHyperLinkColumn>

Thanks,
Princy.
0
Jay Leffue
Top achievements
Rank 1
answered on 17 Dec 2010, 03:50 PM
Super, worked.
0
Nathan
Top achievements
Rank 1
answered on 13 Apr 2012, 09:22 PM
I'm having the same problem, and setting the Datatype hasn't fixed it for me.  I can make a normal GridBound column pointing to the same data field, and it will work fine.  Any other ideas? :)

<telerik:GridHyperLinkColumn DataTextField="RequestDisplayID" DataType="System.String"
    HeaderText="P. Requisition" UniqueName="RequestDisplayID" AutoPostBackOnFilter="true" ShowFilterIcon="false" CurrentFilterFunction="Contains"
    DataNavigateUrlFields="RequestID" DataNavigateUrlFormatString="Requests.aspx?ID={0}" SortExpression="RequestDisplayID" >
</telerik:GridHyperLinkColumn>
Tags
Grid
Asked by
Debashis Pyne
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Jay Leffue
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Nathan
Top achievements
Rank 1
Share this question
or