I have a name column in my grid.
I am trying to get the value in the filter textbox for the name column.
aspx.cs
But I am not getting the textbox control in the program. Value of 'searchName' is Null.
Please help me on this....
I am trying to get the value in the filter textbox for the name column.
<telerik:GridBoundColumn HeaderText="Patient Name" UniqueName="pt_name" DataField="pt_name" > <FilterTemplate> <telerik:RadTextBox ID="RTName" runat="server" Width="200px" ClientEvents-OnValueChanged="ValueChanged" ></telerik:RadTextBox> <telerik:RadScriptBlock ID="RBName" runat="server"> <script type="text/javascript"> function ValueChanged(sender, args) { var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>"); var Name = $find('<%# ((GridItem)Container).FindControl("RTName").ClientID %>'); tableView.filter("pt_name", Name, "StartsWith"); } </script> </telerik:RadScriptBlock> </FilterTemplate> </telerik:GridBoundColumn>aspx.cs
if (e.CommandName == RadGrid.FilterCommandName) { Pair filterPair = (Pair)e.CommandArgument; switch (filterPair.Second.ToString()) { case "pt_Date": { // } case ("pt_name"): { TextBox searchName = (e.Item as GridFilteringItem)[filterPair.Second.ToString()].FindControl("RTName") as TextBox; search = searchName.Text + "%"; break; } } }But I am not getting the textbox control in the program. Value of 'searchName' is Null.
Please help me on this....