Question

<telerik:GridTemplateColumn HeaderText="Code" SortExpression="Code" UniqueName="Code" AllowFiltering="True">
     <ItemTemplate>
         <asp:LinkButton ID="lbCCode" runat="server" Text='<%# Eval("Code") %>' />
     </ItemTemplate>
</telerik:GridTemplateColumn>

So how can I allow RadGrid to filter the results based on the text value of LinkButton? Is there a way to do that?

Was it helpful?

Solution

Please try with the below code snippet.

<telerik:GridTemplateColumn HeaderText="Code" SortExpression="Code" UniqueName="Code" AllowFiltering="True"
        DataField="Code">
    <ItemTemplate>
        <asp:LinkButton ID="lbCCode" runat="server" Text='<%# Eval("Code") %>' />
    </ItemTemplate>
</telerik:GridTemplateColumn>

I have added DataField property in template column. if you get any error in grid then please set EnableLinqExpressions="false" in your grid.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top