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

Problem with Filtertemplate

1 Answer 78 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tobias
Top achievements
Rank 1
Tobias asked on 26 May 2011, 10:23 AM
Hallo,

I have got a problem with the example on Example.

Because of this, i edited my code as following:
<telerik:RadGrid runat="server" ID="Grid_Statistik" AllowMultiRowEdit="false" Skin="Office2007"
            GridLines="None"  PageSize="20" AllowPaging="true" DataSourceID="Grid_Statistik_DataSource" AllowSorting="true"  ShowStatusBar="true" >
             <ExportSettings FileName="File" OpenInNewWindow="True">
                <Pdf PaperSize="A4" PageHeight="210mm" PageWidth="297mm" />
            </ExportSettings>
            <GroupPanel ID="GroupPanel" Text="Gruppierungsfläche">
            </GroupPanel><%----%>
            <MasterTableView Name="Grid_Statistik" runat="server"DataSourceID="Grid_Statistik_DataSource"
                AutoGenerateColumns="false" PageSize="20" AllowPaging="true" AllowMultiRowEdit="false" AllowFilteringByColumn="True">
                <RowIndicatorColumn>
                    <HeaderStyle Width="20px" />
                </RowIndicatorColumn>
                <ExpandCollapseColumn>
                    <HeaderStyle Width="20px" />
                </ExpandCollapseColumn>
                <Columns>
<telerik:GridBoundColumn HeaderText="Employee" UniqueName="Employee"
                        DataField="Employee" DataType="System.String" ReadOnly="True">
                        <FilterTemplate><%--DataSourceID="MA_Source" DataTextField="nameKomplett" DataValueField="hr_m_personal_id" --%>
                          <telerik:RadComboBox id="cbx_MA" runat="server" Skin="Office2007" OnLoad="cbx_MA_Load"
                          SelectedValue='<%# TryCast(Container,GridItem).OwnerTableView.GetColumn("Employee").CurrentFilterValue %>' OnClientSelectedIndexChanged="EmployeeIndexChanged"><%----%>
                            </telerik:RadComboBox>
                                <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                            <script type="text/javascript">
                                    function EmployeeIndexChanged(sender, args) {
                                        var tableView = $find(<%# TryCast(Container,GridItem).OwnerTableView.ClientID %>");
                                        tableView.filter("Employee", args.get_item().get_value(), "EqualTo");
                                }
                                </script>
                            </telerik:RadScriptBlock>
                        </FilterTemplate>
                        <HeaderStyle Width="250px" />
                    </telerik:GridBoundColumn>
 </Columns>
 </MasterTableView>
            <ClientSettings>
                <Scrolling ScrollHeight="415px" AllowScroll="True" UseStaticHeaders="true" />
            </ClientSettings>
            <PagerStyle AlwaysVisible="true" />
            <HeaderContextMenu EnableTheming="True">
 
                <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
            </HeaderContextMenu>
            <FilterMenu EnableTheming="True">
                <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
            </FilterMenu>
        </telerik:RadGrid>

If I use the RadComboBox to edit my filtervalue, my browser returns the following errorcode:
"tableView is null"
Because I used the code of the example, it might be a copy paste problem, but I don't see the mistake.....

Best regards

1 Answer, 1 is accepted

Sort by
0
Accepted
Mira
Telerik team
answered on 31 May 2011, 01:36 PM
Hello Tobias,

I assume the cause of the error is that you have missed one quote in your code (the one marked with yellow):
var tableView=$find("<%# TryCast(Container,GridItem).OwnerTableView.ClientID %>");

Please try the code above and let me know whether it works.

All the best,
Mira
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
Tobias
Top achievements
Rank 1
Answers by
Mira
Telerik team
Share this question
or