find costum control in filter template

2 posts, 0 answers
  1. mohamadreza
    mohamadreza avatar
    2 posts
    Member since:
    Oct 2016

    Posted 02 Aug 2017 Link to this post

    I'm trying to filter a column of a grid table using a custom persian datepicker control that mentioned in Grid - Filter Templates demo. but it couldn't find that custom date picker in javascript code , so the alert function returns "null".

    plz help.

    <telerik:RadGrid RenderMode="Lightweight" ID="RadGrid2" ShowStatusBar="true" runat="server" AllowPaging="True"                    PageSize="5" DataSourceID="sds_RadGrid_Records" AllowFilteringByColumn="true" >
                        <MasterTableView Width="100%" AutoGenerateColumns="false" DataKeyNames="AutoCnt"                        DataSourceID="sds_RadGrid_Records">
                            <Columns>
                                <telerik:GridBoundColumn ItemStyle-Width="30px" UniqueName="RegNumber" ShowFilterIcon="false" DataField="RegNumber" HeaderText="RegNumber"  CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" FilterDelay="2000">
                                </telerik:GridBoundColumn>
     
                                <telerik:GridBoundColumn ItemStyle-Width="30px" UniqueName="Barid_ID" DataField="Barid_ID" HeaderText="Barid_ID"
                                    CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" >
                                </telerik:GridBoundColumn>
     
                                <telerik:GridBoundColumn ItemStyle-Width="30px" ShowFilterIcon="false" UniqueName="People" DataField="People" HeaderText="People"
                                    CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" FilterDelay="10000">
                                </telerik:GridBoundColumn>
     
                                <telerik:GridDateTimeColumn  DataType="System.DateTime" UniqueName="RegDate" DataField="RegDate" HeaderText="RegDate">
                                <%--<ItemTemplate>                               
                                    <asp:Label ID="Label32" runat="server" Text='<%# Fadate.GetFaDate_WithEslash(Eval("RegDate")) %>'></asp:Label>
                                </ItemTemplate>--%>
                                    <FilterTemplate>
                                        <telerik:RadLabel runat="server" AssociatedControlID="txt_Filter_RegDate_From" Text="From" Style="padding-left: 5px;"></telerik:RadLabel>
                                        <rhp:DatePicker ID="txt_Filter_RegDate_From" runat="server" OnUpdate="FromDateSelected" Width="80px"></rhp:DatePicker>                               
                                         
     
                                        <telerik:RadLabel runat="server" AssociatedControlID="txt_Filter_RegDate_To" Text="To" Style="padding-left: 5px;"></telerik:RadLabel>
                                        <rhp:DatePicker ID="txt_Filter_RegDate_To" runat="server" Width="80px"></rhp:DatePicker>
                                        
                                         
                                      <telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">
                                        <script type="text/javascript">                                       
                                            function FromDateSelected(calendar) {   
                                                var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                               var ToPicker = $find('<%# ((GridItem)Container).FindControl("txt_Filter_RegDate_To").ClientID %>');
                                                alert(ToPicker);
                                            }
                                        </script>
                                            </telerik:RadScriptBlock>
                                    </FilterTemplate>
                                </telerik:GridDateTimeColumn>
     
                            </Columns>
                        </MasterTableView>
                        <ClientSettings AllowKeyboardNavigation="true" EnablePostBackOnRowClick="false">
                            <Selecting AllowRowSelect="true"></Selecting>
                        </ClientSettings>
                        <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
                    </telerik:RadGrid>

  2. mohamadreza
    mohamadreza avatar
    2 posts
    Member since:
    Oct 2016

    Posted 03 Aug 2017 in reply to mohamadreza Link to this post

    no one could help?!
Back to Top