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

Issue getting RadGrid-MasterTableView instance on client-side

1 Answer 157 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Greg
Top achievements
Rank 1
Greg asked on 23 Dec 2012, 01:18 PM
Hi,

I am having an issue getting the RadGrid-MasterTableView on client-side. I have a RadGrid on the page which does not have static defined columns and I cannot get the mastertableview. Also I defined some static columns and still cannot get the MasterTableVIew.

My final goal is add columns to my RadGrid on the fly using client-side. I could defined to static columns there but other columns are going to be added on dynamically.

What I am missing in my code that I cannot get the MasterTable to add my data to the grid
Thank you in advance


This the code that I am using to get those intance and I can get the grid object but not the MasterTable
   var grid = $find("<%=RadGrid1.ClientID %>");
                       var MasterTable = grid.get_masterTableView();  
                       
//                       var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView();

<telerik:RadGrid ID="RadGrid1" runat="server" autogeneratecolumns="false" allowsorting="true" allowpaging="true">
<PagerStyle AlwaysVisible="true" />
   <MasterTableView>
     <Columns>
       <telerik:GridBoundColumn DataField="automobile" UniqueName="automobile" HeaderText="automobile" ></telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="betrayal" UniqueName="betrayal" HeaderText="betrayal" ></telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="DataSourceRecordID" UniqueName="DataSourceRecordID" HeaderText="DataSourceRecordID" ></telerik:GridBoundColumn>
     </Columns>
   </MasterTableView>
</telerik:RadGrid>

1 Answer, 1 is accepted

Sort by
0
Accepted
Jayesh Goyani
Top achievements
Rank 2
answered on 24 Dec 2012, 08:07 AM
Hello,

Please add dummy data to generate MasterTableview.

Please check below link for demo/sample code.
http://www.telerik.com/community/forums/aspnet-ajax/grid/bind-radgrid-client-side-to-a-json-array.aspx#1965527

Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Greg
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or