简体   繁体   中英

Telerik RadGrid Column Filtering on Text Value of LinkButton

<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?

Thanks.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM