This is a migrated thread and some comments may be shown as answers.

Filter Template RadTextBox

2 Answers 194 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ken
Top achievements
Rank 1
Ken asked on 14 May 2012, 01:03 AM
I am not sure why this does not work ...
I get an error on the args.getvalue() of Object doesn't support property or method 'get_value'


<telerik:GridBoundColumn DataField="Name" FilterControlAltText="Filter Name column"
    FooterText="<h6>Count: " Aggregate="Count" AutoPostBackOnFilter="true" CurrentFilterFunction="StartsWith"
    ShowFilterIcon="False" HeaderText="Name" SortExpression="Name" UniqueName="Name"
    FooterStyle-HorizontalAlign="Left" AllowSorting="true" AllowFiltering="true"
    ItemStyle-HorizontalAlign="Left" ItemStyle-Wrap="false">
    <FilterTemplate>
        <telerik:RadTextBox ID="RadName" runat="server" Width="100px" ClientEvents-OnValueChanged="NameChanged">
        </telerik:RadTextBox>
        <telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">
            <script type="text/javascript">
                function NameChanged(sender, args) {
                    var txtbox = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                    txtbox.filter("Name", args.get_value(), "StartsWith");
                }
            </script>
        </telerik:RadScriptBlock>
    </FilterTemplate>
</telerik:GridBoundColumn>

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 14 May 2012, 08:03 AM
Hi Ken,

Please take a look into the following Javascript I tried.

Javascript:
<script type="text/javascript">
    function NameChanged(sender, args) {
        var txtbox = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
        txtbox.filter("Name", sender.get_value(), "StartsWith");
    }
</script>

Hope this helps.

Thanks,
Princy.
0
Ken
Top achievements
Rank 1
answered on 14 May 2012, 02:00 PM
That seems to work just fine... wierd though for a combobox args.get_item().get_value() works
Thanks
Tags
Grid
Asked by
Ken
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Ken
Top achievements
Rank 1
Share this question
or