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

Microsoft JScript runtime error: 'grid.get_masterTableView()' is null or not an object

2 Answers 70 Views
Grid
This is a migrated thread and some comments may be shown as answers.
amit
Top achievements
Rank 1
amit asked on 05 Aug 2011, 08:09 PM
Hi ,
I am new to Telerik Controls.I downloaded the sample Web Email AJAX .I removed Linq datasource and use my own database binding,But when I am clicking for Sort on grid view(e.g. From,Subject,Date) I got following error.I appreciate if someone can help me.

Microsoft JScript runtime error: 'grid.get_masterTableView()' is null or not an object

Thanks,
Amit  

2 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 08 Aug 2011, 12:54 PM
Hi Amit,

A possible reason for the get_masterTableView() method to return null is if you are trying to access the MasterTableView before it is created. If it is called after the GridCreated client-side event, it should always return the respective MasterTableView client object.

Best wishes,
Pavlina
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.

0
amit
Top achievements
Rank 1
answered on 08 Aug 2011, 04:00 PM
To resolve issue I added the sort command. 
 

protected  

void RadGrid1_SortCommand(object source, Telerik.Web.UI.GridSortCommandEventArgs e)

 

{

 

 

GridSortExpression expression = new GridSortExpression();

 

 

 

if(e.Item.OwnerTableView.SortExpressions.Count == 0 || e.Item.OwnerTableView.SortExpressions[0].FieldName != e.SortExpression)

 

{

expression.SortOrder =

GridSortOrder.Descending;

 

}

 

else if(e.Item.OwnerTableView.SortExpressions[0].SortOrder == GridSortOrder.Descending)

 

{

expression.SortOrder =

GridSortOrder.Ascending;

 

}

 

else if(e.Item.OwnerTableView.SortExpressions[0].SortOrder == GridSortOrder.Ascending)

 

{

expression.SortOrder =

GridSortOrder.None;

 

}

e.Item.OwnerTableView.SortExpressions.AddSortExpression( expression );

e.Item.OwnerTableView.Rebind();

 

BindGrid(selectedNode);//This function will done DB binding.  

}



Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: An item with the same key has already been added.

Tags
Grid
Asked by
amit
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
amit
Top achievements
Rank 1
Share this question
or