[英]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? 那么,如何允许RadGrid基于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. 我在模板列中添加了DataField属性。 if you get any error in grid then please set EnableLinqExpressions="false" in your grid.
如果您在网格中遇到任何错误,请在网格中设置EnableLinqExpressions =“ false” 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.