Problem: I want to filter an ASP TextBox
"<asp:TextBox ID="TXTName" runat="server" Text='<%# eval("Name") %>' ></asp:TextBox>"
in Telerik GridTemplateColumn .Also I dont want filter Icon to display and I Want "StartsWith" Filter Function.
Sloution: Just give DataField="DataFieldName" in GridTemplateColumn.The DataField Name which you are using to evaluate TextBox.
Example:
<asp:TextBox ID="TXTName" runat="server" Text='<%# eval("Name") %>' ></asp:TextBox>
Must BE Given To DataField e.g DataField="Name".
Yellow Is Common For Both
Here Is The Sample Code:
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" >
<MasterTableView AllowFilteringByColumn="True" >
<Columns>
<telerik:GridTemplateColumn AllowFiltering="true" AutoPostBackOnFilter="true" HeaderText="Name" datafield="Name" DataType="System.String"
ShowFilterIcon="false" CurrentFilterFunction="StartsWith" UniqueName="Name" >
<ItemTemplate>
<asp:TextBox ID="TXTName" runat="server" Text= '<%# eval("Name") %>' >
</asp:TextBox>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
"<asp:TextBox ID="TXTName" runat="server" Text='<%# eval("Name") %>' ></asp:TextBox>"
in Telerik GridTemplateColumn .Also I dont want filter Icon to display and I Want "StartsWith" Filter Function.
Sloution: Just give DataField="DataFieldName" in GridTemplateColumn.The DataField Name which you are using to evaluate TextBox.
Example:
<asp:TextBox ID="TXTName" runat="server" Text='<%# eval("Name") %>' ></asp:TextBox>
Must BE Given To DataField e.g DataField="Name".
The Green Highlighted Text Is For Filter Icon To Hide and For Filtering With "StartsWith"
The Aqua Highlighted text is For Filtering a String From Label Yellow Is Common For Both
Here Is The Sample Code:
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" >
<MasterTableView AllowFilteringByColumn="True" >
<Columns>
<telerik:GridTemplateColumn AllowFiltering="true" AutoPostBackOnFilter="true" HeaderText="Name" datafield="Name" DataType="System.String"
ShowFilterIcon="false" CurrentFilterFunction="StartsWith" UniqueName="Name" >
<ItemTemplate>
<asp:TextBox ID="TXTName" runat="server" Text= '<%# eval("Name") %>' >
</asp:TextBox>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
No comments:
Post a Comment