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

[Solved] 2010 Web Part Javascript Radgrid Issue

3 Answers 69 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 24 May 2013, 09:03 PM
I am attempting to recreate the Grid - Edit on Double-click in a SharePoint 2010 web part.  I have successfully added the script to the page using a ClientScriptManager in the PreRender method.  I also generate my RadAjaxManager in OnInit.

However, when I double click on an item I receive an error on the page, "'null' is null or not an object"

The line number it corresponds to in the page source is
$find("<%= RadGrid1.ClientID %>").get_masterTableView().editItem(editedRow);
within the RowDblClick function.

Any help would be appreciated.

Thanks!



3 Answers, 1 is accepted

Sort by
0
Mark
Top achievements
Rank 1
answered on 28 May 2013, 03:49 PM
It's definitely the get_masterTableView() method, but I can't seem to figure out why.  Does anyone have any suggestions?

Thanks,
Mark
0
Mark
Top achievements
Rank 1
answered on 28 May 2013, 08:01 PM
So, trying both tactics in this link did not prove successful, unfortunately.
0
Tsvetoslav
Telerik team
answered on 29 May 2013, 03:49 PM
Hello Mark,

Please, open up a formal support ticket and send your code as a file attachment. Generally, I'd recommend that you take the client scripts out into a separate file and load the file from your webpart. For example, if the files is named Helper.js, your code should be as follows:

private const string clientAPIFileName = "GridResources/Scripts/HelperScripts.js";
 
string location = ClassResourcePath + "/";
 
string includeScript = String.Format(IncludeScriptFormat, "javascript", location, clientAPIFileName);
 
ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "clientAPIIncludeScript", includeScript, false);

This code supposes that you have under the Microsoft Shared\Web Server Extensions\wpresources\NameOfYourWebPart_VersionAndKeyToken  a inner folder named GridResources and another one within the latter called Scripts.

Hope it helps.
 
Regards,
Tsvetoslav
Telerik
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.
Tags
Grid
Asked by
Mark
Top achievements
Rank 1
Answers by
Mark
Top achievements
Rank 1
Tsvetoslav
Telerik team
Share this question
or