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

[Solved] Filtering in a GridTemplateColumn with a LinkButton

1 Answer 178 Views
Grid
This is a migrated thread and some comments may be shown as answers.
kencox
Top achievements
Rank 1
kencox asked on 28 Jul 2009, 10:19 PM
My client wants to be able to click on a part number to begin editing the record.  He also wants to be able to filter on the PartNumber field.

When I attempt to filter on the following column, I get the error "The query syntax is not valid., near keyword 'LIKE', line 6, column 6." (Using Entity Framework.

How do I get a LinkButton and filtering to work together?

Here's the code:

                    <telerik:GridTemplateColumn UniqueName="TemplateColumn4" AllowFiltering="True" Groupable="False" 
                        HeaderStyle-Width="55px" ItemStyle-Width="55px" Reorderable="False" ShowSortIcon="True">  
                        <ItemTemplate> 
                            <asp:LinkButton  runat="server" CausesValidation="false" CommandName="Edit" 
                                Text='<%#Eval("PartNumber") %>' /> 
                        </ItemTemplate> 
                        <HeaderStyle Width="55px"></HeaderStyle> 
                        <ItemStyle Width="55px"></ItemStyle> 
                    </telerik:GridTemplateColumn> 

Ken

1 Answer, 1 is accepted

Sort by
0
kencox
Top achievements
Rank 1
answered on 28 Jul 2009, 10:38 PM

As so often happens, I found the answer a few minutes after posting. Here's my version of the code found here.

http://www.telerik.com/community/code-library/aspnet-ajax/grid/filtering-and-sorting-for-gridbuttoncolumn.aspx

                    <custom:GridButtonColumnWithFilteringSorting HeaderText="Item #" UniqueName="PartNumber" 
                        SortExpression="PartNumber" DataTextField="PartNumber" DataField="PartNumber" 
                        CommandName="Edit" ButtonType="LinkButton" /> 
Tags
Grid
Asked by
kencox
Top achievements
Rank 1
Answers by
kencox
Top achievements
Rank 1
Share this question
or