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

[Solved] GridHyperLinkColumn Filter with Linq...

5 Answers 192 Views
Grid
This is a migrated thread and some comments may be shown as answers.
tom
Top achievements
Rank 1
tom asked on 26 Mar 2009, 06:31 AM
Linq Filter does not work with GridHyperLinkColumn.
I use field data as an url link. 
(filterExpression does not have field name - instead of "Name.Contains...", it has only ".Contains..." and return error)

How do I correct the problems?
Thanks.
 

5 Answers, 1 is accepted

Sort by
0
tom
Top achievements
Rank 1
answered on 28 Mar 2009, 02:34 PM
Anybody has this problem?
0
Nikolay Rusev
Telerik team
answered on 31 Mar 2009, 07:06 AM
Hello Tom,

GridHyperLinkColumn filter on it's DataTextField and you should also have DataType set in order to have correct filter working.
For your convenience I am attaching sample application.

All the best,
Nikolay
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
tom
Top achievements
Rank 1
answered on 02 Apr 2009, 02:09 PM
Thanks,
It does not work with LINQ data binding. Is it a bug?

Here is the databind:

<telerik:GridHyperLinkColumn 
    UniqueName="Name" 
    DataTextField="Name" 
    HeaderText="Name" 
    DataType="System.String"
    DataNavigateUrlFields="Name"
    DataNavigateUrlFormatString="http://www.google.com/search?q={0}">
</telerik:GridHyperLinkColumn>                              

...

                <DataBinding SelectMethod="GetDataAndCount" Location="DataService.svc"
                    SortParameterType="Linq" FilterParameterType="Linq" EnableCaching="False">
                </DataBinding>


the filterExpression when I type in a value will have value:
.StartsWith(\"xyz\")

the DataTextField is missing tin the filter expression.

Thanks.
0
tom
Top achievements
Rank 1
answered on 04 Apr 2009, 08:48 AM
Is it a bug with Telerik LINQ?
Should I fill a support ticket for this?

Thanks.
0
Nikolay Rusev
Telerik team
answered on 06 Apr 2009, 11:39 AM
Hello Tom,

I just realized from your last post that you are using RadGrid with client-side data-binding.
Unfortunately filtering on GridHyperLinkColumn with client-side data binding is not currently supported.
However you can easily workaround this by attaching handler for client event OnCommand and placing the following code into it:
function RadGrid_Command(sender, args)  
        {  
            args.get_tableView().get_filterExpressions().forEach(  
            function(expression)  
            {                  
                if (expression.get_columnUniqueName() == "YourColumn_UniqueName")  
                    expression.set_fieldName("YourColumn_DataTextField");  
            }  
            );              
        } 

Hopefully more improvements will be added to RadGrid client-side data-binding and this funcitonality will be build into it.

I hope this helps.

Regards,
Nikolay
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
tom
Top achievements
Rank 1
Answers by
tom
Top achievements
Rank 1
Nikolay Rusev
Telerik team
Share this question
or