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

Filtering on GridHyperLinkColumn

1 Answer 227 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Amy
Top achievements
Rank 1
Amy asked on 29 Nov 2010, 06:30 PM
Hi!  I'm getting a SQL Exception error (invalid column name) when trying to filter on a GridHyperLinkColumn.  What I'm trying to do is show the name of a person in the column with a hyperlink to the person's email address.

Here's the code from the aspx page:
<telerik:GridHyperLinkColumn DataNavigateUrlFields="Email1" UniqueName="Email1"
DataNavigateUrlFormatString
="mailto:{0}" DataTextField="Name"
HeaderText="Reviewer" SortExpression="Email1" ShowFilterIcon="false"
ShowSortIcon
="false" AutoPostBackOnFilter="true" />

The stored procedure which populates the radgrid does pull back column names "Name" and "Email1".  The radgrid appears to display correctly in that I do see the names of people and if I click on one of the names my mail client does open up an email window with the person's name in the "To:" field.

However, when I attempt to filter on the column I receive the following error (regardless of whether I type in a person's name or email address:
System.Web.HttpUnhandledException: 
Exception of type 'System.Web.HttpUnhandledException' was thrown. 
---> System.Data.SqlClient.SqlException: Invalid column name 'Name'.

Is it possible to do this type of functionality GridHyperLink column where the data displayed comes from one column in a database table but the hyperlink ability uses another column in the database?

Thanks!

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 02 Dec 2010, 10:35 AM
Hi Amy,

The GridHyperLinkColumn uses the field name specified by the DataTextField for filtering. You have specified "Name" as the columns DataTextField and this is the field name used in the SQL query for filtering. The error you are getting does not seem to be related to the hyperlink column.

Best,
Veli
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
Amy
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or