get_masterTableView() is null for radgrid from UserControl

4 posts, 0 answers
  1. Dhamodharan
    Dhamodharan avatar
    300 posts
    Member since:
    Sep 2010

    Posted 19 Dec 2012 Link to this post

    Hi All,

    I am using Radgrid into User Control. that user control defined into RadWindow in aspx page. when i am clicking the link button that window will popup and i want to assign datasource like. radgrid.get_masterTableView().set_dataSource(new Array()). but radgrid.get_masterTableView() return null values. i want to assign datasource only in client side. please let me know how to solve this issue.

    Here i have attached code.

    in aspx page

    <asp:LinkButton ID="lnkSymptoms" runat="server" Text="Symptoms : " OnClientClick="return lnkSymptom_clientClick()"></asp:LinkButton>
    <telerik:RadWindow runat="server" ID="rwSymptoms" Title="Symptoms" VisibleStatusbar="false"
                        Width="600px" Height="430px" Modal="true" EnableShadow="true" Skin="Web20" Opacity="100">
                            <div id="divSymptoms" runat="server">
                                <ucSymptom:ucSymptom ID="ucSymptomsCtrl" runat="server" />


     function lnkSymptom_clientClick(sender, args) {
    var rgSymptoms = $find("ctl00_ContentPlaceHolder1_rwSymptoms_C_ucSymptomsCtrl_rgSymptoms").get_masterTableView();             
                        rgSymptoms.set_dataSource(new Array());

    ascx page

    <telerik:RadGrid ID="rgSymptoms" runat="server" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center"
                    Width="370px" EnableViewState="false" PagerStyle-Visible="false" >
                    <ClientSettings ClientEvents-OnCommand="function() {}" >                  
                    <MasterTableView CommandItemDisplay="None" AutoGenerateColumns="false" AllowSorting="true"
                        AllowPaging="true" DataKeyNames="sys_con_id" ClientDataKeyNames="sys_con_id">
                                No records to be displayed</center>
                            <telerik:GridTemplateColumn UniqueName="Description" HeaderText="Condition">
                                <ItemStyle VerticalAlign="Top" Wrap="false" HorizontalAlign="Left" />
                                <HeaderStyle Width="220px" />
                                    <asp:Label ID="Description" runat="server" SkinID="NoBold"></asp:Label>
                                    <asp:TextBox runat="server" ID="txtDesc" Style="display: none;" onchange="javascript:return UpdateOtherValue(this)"></asp:TextBox>

    Thanks in Advance,

  2. Angel Petrov
    Angel Petrov avatar
    1003 posts

    Posted 21 Dec 2012 Link to this post

    Hello Dhamodharan,

    Please try out the following:
    function lnkSymptom_clientClick(sender, args)
                var window = $find('<%= rwSymptoms.ClientID %>');
                var grid = $telerik.findControl(window.get_contentElement(), "rgSymptoms");
                grid .get_masterTableView();
                return false;

    All the best,
    Angel Petrov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. DevCraft R3 2016 release webinar banner
  4. Ayyappa
    Ayyappa avatar
    1 posts
    Member since:
    Aug 2014

    Posted 01 Mar in reply to Angel Petrov Link to this post

    Hi Angel,


    I'm facing the same issue, and I have tried the solution you gave. But its not working.

  5. Eyup
    Eyup avatar
    2941 posts

    Posted 04 Mar Link to this post

    Hello Ayyappa,

    You can check the explanation provided in the following post and try to implement the second approach:

    I hope this will prove helpful.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top