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

get_masterTableView() is null for radgrid from UserControl

3 Answers 193 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dhamodharan
Top achievements
Rank 1
Dhamodharan asked on 19 Dec 2012, 11:06 AM
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">
                    <ContentTemplate>
                        <div id="divSymptoms" runat="server">
                            <ucSymptom:ucSymptom ID="ucSymptomsCtrl" runat="server" />
                        </div>
                    </ContentTemplate>
                </telerik:RadWindow>

javascript

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

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() {}" >                  
                </ClientSettings>
                <MasterTableView CommandItemDisplay="None" AutoGenerateColumns="false" AllowSorting="true"
                    AllowPaging="true" DataKeyNames="sys_con_id" ClientDataKeyNames="sys_con_id">
                    <NoRecordsTemplate>
                        <center>
                            No records to be displayed</center>
                    </NoRecordsTemplate>
                    <Columns>
                        <telerik:GridTemplateColumn UniqueName="Description" HeaderText="Condition">
                            <ItemStyle VerticalAlign="Top" Wrap="false" HorizontalAlign="Left" />
                            <HeaderStyle Width="220px" />
                            <ItemTemplate>
                                <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>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>                    
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>

Thanks in Advance,
Dhamodharan.S


3 Answers, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 21 Dec 2012, 05:07 PM
Hello Dhamodharan,

Please try out the following:
function lnkSymptom_clientClick(sender, args)
        {
            var window = $find('<%= rwSymptoms.ClientID %>');
            window.show();
            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.
0
Ayyappa
Top achievements
Rank 1
answered on 02 Mar 2016, 05:40 AM

Hi Angel,

 

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

0
Eyup
Telerik team
answered on 04 Mar 2016, 02:45 PM
Hello Ayyappa,

You can check the explanation provided in the following post and try to implement the second approach:
http://marketplace.telerik.com/forums/client-side-help-required#vBzJZGDiMkGnpEnfoy2ShA


I hope this will prove helpful.

Regards,
Eyup
Telerik
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
Tags
Grid
Asked by
Dhamodharan
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Ayyappa
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or