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

$find RadGrid is null in user control

0 Answers 125 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 08 Jun 2012, 02:54 AM
Hi
I have a user control (ascx) with a radgrid. The user control is placed in a container control and that is placed in update panel.
I always get 
$find("ctl00_phMain_FS_TreeClients_ClientsList1_RadGrid1") is null

I've tried to move the container out of the update panel but the result is the same.
here is my user control code

    <script type="text/javascript">
        function RefreshClientGrid() {
            try
            {
                var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
                masterTable.rebind();
            }catch(Error)
            {
                alert(Error);
            }
             
        }
    </script>
<asp:Label ID="CompanyIdLabel" runat="server" Visible="False"></asp:Label>
<uc1:FSCompanyReadOnly ID="FSCompanyReadOnly1" runat="server" />
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True"
    AutoGenerateColumns="False" DataSourceID="LinqDataSource1"
    GridLines="None" Skin="Telerik"
    PageSize="15" CellSpacing="0" OnItemCommand="RadGrid1_ItemCommand"
    AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
    AllowAutomaticUpdates="True">
    <MasterTableView DataKeyNames="ClientId" CommandItemDisplay="Top" ClientDataKeyNames="ClientId">
        <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
        <RowIndicatorColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
        <ExpandCollapseColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
        <Columns>
            <telerik:GridEditCommandColumn ButtonType="LinkButton" UniqueName="EditCommandColumn">
                <ItemStyle CssClass="GridImageButton" />
            </telerik:GridEditCommandColumn>
            <telerik:GridBoundColumn DataField="ClientId" DataType="System.Int32" HeaderText="ClientId"

Help please

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Peter
Top achievements
Rank 1
Share this question
or