Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
359 views
I have a javascript function on a Webform which I call from code behind like below. It works fine without the RadAjaxManager.
 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>

As soon as I add the script manager and fire the javascript, I get an error in the DOM saying:
JavaScript critical error at line 343, column 42 in http://localhost:32135/3DPrototypeQuote.aspx\n\nSCRIPT1004: Expected ';' 

Note there is a semicolon missing between NovaCopyStlViewer('/assets/Inverted.stl') and Sys.Application.add_init(function()) , here is where the Visual Studio is telling me there is a semi colon missing. 

<script type="text/javascript">
//<![CDATA[
NovaCopyStlViewer('/assets/Inverted.stl')Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadAjaxManager, {"_updatePanels":"","ajaxSettings":[],"clientEvents":{OnRequestStart:"",OnResponseEnd:""},"defaultLoadingPanelID":"","enableAJAX":true,"enableHistory":false,"links":[],"styles":[],"uniqueID":"ctl00$ContentPlaceHolder1$RadAjaxManager1","updatePanelsRenderMode":0}, null, null, $get("ctl00_ContentPlaceHolder1_RadAjaxManager1"));
});
//]]>
</script>








 try
            {
                FileUpload fileUpload = FileUploadControl;

                string physicalFolder = Server.MapPath("~/assets/");
                if (fileUpload.HasFile)
                {
                    string uploadFile = physicalFolder + fileUpload.FileName;
                    fileUpload.SaveAs(uploadFile);

                    string testFile = "/assets/" + fileUpload.FileName;
   
                   ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "NovaCopyStlViewer('" + testFile + "')", true);
                }
            }
            catch (Exception)
            {

                throw;
            }



 <script type="text/javascript">
        function NovaCopyStlViewer(file)
        {

            var cv = document.getElementById('canvas_drop');
            cv.style.display = 'block';

            var e = document.getElementById('select_options');
            e.style.display = 'block';

            var mycanvas = document.getElementById('upload_canvas');
            var viewer = new JSC3D.Viewer(mycanvas);
            var theScene = new JSC3D.Scene;

            var stlpath = file;
            viewer.setParameter('SceneUrl', stlpath);
            viewer.setParameter('InitRotationX', 20);
            viewer.setParameter('InitRotationY', 20);
            viewer.setParameter('InitRotationZ', 0);
            viewer.init();
            viewer.update();
        }
    </script>























Felix
Top achievements
Rank 1
 answered on 06 Feb 2015
1 answer
137 views
Hi team,

I have a aspx page with two linkbuttons(mytoolkits and all toolkits). The scenario is when I am clicking on my toolkit my radgrid is binding into athe mytoolkit datatable and when I am clicking on all toolkits the same radgrid is binding to alltoolkits datatable. my problem is that radgrid is working well in all cases (filter mode and edit mode when I am clicking on my toolkits linkbutton) but when I am clicking on the all toolkits radgrid is missing the styles in filter and edit mode that it means all the datepickers popup button is disappear and the text( open the popup ..) will appear and all calendars in edit mode and filtering have no style and it is opening somewhere in the page and it happens just in IE9.  
what I did to fix this issue?
1- searched so much and set the EnableAjaxRendering=true for radgrid and datepickers of that columns in page-load and it didn't work.
2- when I used radstylesheet manager it was creating the 31 error and it wasn't change anything.

the radgrid is in the RadajaxPanel and something that is interesting is when I add a Raddatepicker control to the page out of the radgrid so far that the raddatepicker is before Radgrid even after post back of all toolkits it works well. but when I add that raddatepicker after Radgrid (either inside ajaxPanel or outside of it) it get's the same issue of the other raddatepickers in radgrid and is losing it's skin. would you please let me know what is wrong with it?










Maria Ilieva
Telerik team
 answered on 06 Feb 2015
3 answers
970 views
Is it possible to Enable or disable the Tab strip based on the Rad Grid Condition. I have Three Tabs and each tab has a RadGrid in it. When a Grid is in Edit mode, I want to Disbale the TasbStrip so that users can not move to a different Tab. Once the users either update or cancel the edit Tab Strip should be enabled back.

I tried setting Tabstrip.enabled to false on Grid Prerender and Item Command, but did not work.

Thanks for your help and advice.

Thanks,
Siva
Ivan Danchev
Telerik team
 answered on 06 Feb 2015
1 answer
107 views
Hi

I am need to add a new row and then setup some default values while using batch edit.  The code below causes problems once it has executed.  It executes fine but seems to not save the values properly.  Could someone verify if I am setting the column data properly with the last two lines?

Many thanks,

Jon
  var uxRadGrid = $find("<%=uxRadGrid.ClientID%>");
  var uxRadGrid_MasterTable = uxRadGrid.get_masterTableView();
  var uxRadGrid_batchEditingManager = uxRadGrid.get_batchEditingManager();
  uxRadGrid_batchEditingManager.addNewRecord(uxRadGrid_MasterTable);
 
  var uxRadGrid_MasterTable_row = uxRadGrid_MasterTable.get_dataItems()[0];
//  uxRadGrid_MasterTable_row.get_cell("BudgetValue").innerText = '£0.00';
  //uxRadGrid_MasterTable_row.get_cell("BudgetDetailId").innerText = ' ';
  uxRadGrid_MasterTable_row.get_cell("CategoryId").innerText = idValue;
  uxRadGrid_MasterTable_row.get_cell("Category").innerText = textValue;
Eyup
Telerik team
 answered on 06 Feb 2015
1 answer
118 views
Hi,
     i would like to know if it is possible to know if it is possible to extract the pager information during the NeedDataSource event.

I supposed it can be done with a custom pager, but i would like to reuse basic pager.
I need this because i have not a local db, but have to call a remote wcf service with a simple call (no odata or similar).

If cannot, do you suggest ObjectDataSource or Custom Pager?

Thx in advance
Mauro Dalla Zuanna

<telerik:RadGrid ID="RadGridMain" runat="server" AllowSorting="True" AllowPaging="True" AllowFilteringByColumn="True" PageSize="12" 
OnNeedDataSource="RadGridTransazioni_NeedDataSource">

....

</telerik:RadGrid>

#Code behind
protected void RadGridMain_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e) {
  WcfClient client = new WcfClient();
  List<DataType> returnedData = client.ReturnData( <... sort, page number, number of records ...>);
  this.RadGridMain.DataSource = returnedData;
}
Angel Petrov
Telerik team
 answered on 06 Feb 2015
2 answers
306 views
I'm having a weird occurrence when adding a RadAjaxManager to a Webform. From ButtonClick codebehind I am calling a java script function successfully, but fails when I add a RadAjaxManager.

CodeBehind:
    protected void btnUpload3DModel_Click(object sender, EventArgs e)
        {

            try
            {
                FileUpload fileUpload = FileUploadControl;

                string physicalFolder = Server.MapPath("~/assets/");
                if (fileUpload.HasFile)
                {
                    string uploadFile = physicalFolder + fileUpload.FileName;
                    fileUpload.SaveAs(uploadFile);

                    string testFile = "/assets/" + fileUpload.FileName;
   
                   ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "NovaCopyStlViewer('" + testFile + "')", true);
                }
            }
            catch (Exception)
            {

                throw;
            }

        }

Javascript function:

 <script type="text/javascript">
        function NovaCopyStlViewer(file)
        {

            var cv = document.getElementById('canvas_drop');
            cv.style.display = 'block';

            var e = document.getElementById('select_options');
            e.style.display = 'block';



            var mycanvas = document.getElementById('upload_canvas');
            var viewer = new JSC3D.Viewer(mycanvas);
            var theScene = new JSC3D.Scene;

            var stlpath = file;
            viewer.setParameter('SceneUrl', stlpath);
            viewer.setParameter('InitRotationX', 20);
            viewer.setParameter('InitRotationY', 20);
            viewer.setParameter('InitRotationZ', 0);
            viewer.init();
            viewer.update();
        }
    </script>



The error I am seeing after adding RadAjaxManager is as follows
JavaScript critical error at line 343, column 42 in http://localhost:32135/3DPrototypeQuote.aspx\n\nSCRIPT1004: Expected ';' 

Notice there is no SemiColon between NovaCopyStlViewer('/assets/Inverted.stl') and Sys.Application.add_init(function() 
This is where Visual Studio is showing the error. 

DOM:
<script type="text/javascript">
//<![CDATA[
NovaCopyStlViewer('/assets/Inverted.stl')Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadAjaxManager, {"_updatePanels":"","ajaxSettings":[],"clientEvents":{OnRequestStart:"",OnResponseEnd:""},"defaultLoadingPanelID":"","enableAJAX":true,"enableHistory":false,"links":[],"styles":[],"uniqueID":"ctl00$ContentPlaceHolder1$RadAjaxManager1","updatePanelsRenderMode":0}, null, null, $get("ctl00_ContentPlaceHolder1_RadAjaxManager1"));
});
//]]>
</script>





















Peter Filipov
Telerik team
 answered on 06 Feb 2015
1 answer
126 views
I am using a RadTreeList control on an ASPX page.   When Inserting a new node on the tree, I am validating what the user entered in the editbox.  However, when I call the alert() and then cancel the event, the alert dialog is not displayed.

I have similar code for the Edit it works just fine.  The only difference is the message being displayed.  The errorString variable built based upon the errors found in the validation of the control.

SiteAspNetMaster samInsert = (SiteAspNetMaster)Page.Master;
if (samInsert != null)
{
           samInsert.Alert(errorString, 400, 100, "Alert");
}
e.Canceled = true;


Thank you.


Konstantin Dikov
Telerik team
 answered on 06 Feb 2015
1 answer
148 views
Like the subject says, the editor is in control that's used as an editor for a grid. When I go to edit a row, the value in the editor is always blank and unclickable when an AjaxPanel is on the page. I can remove the panel is everything works as it should. Even though there is no value shown, I can still hit update and the real values are still saved. Am I missing something that has to do with AJAX and the editor?
Marin Bratanov
Telerik team
 answered on 06 Feb 2015
1 answer
187 views
Hi,

The Rad Editor toolbar is not rendering correctly. On loading of editor, the tool bar is stretched to the bottom covering the entire content are and the editor does not appear to be editable.

Telerik version : 2010.2.1029.35
Browser : IE 8,9 and 11

Thanks in advance for the suggestions.

Misho
Telerik team
 answered on 06 Feb 2015
1 answer
175 views
After updating to the latest version of Telerik, we are encountering issues with the rcbSprite image of the RadCombobox

Any thoughts on how to resolve this issue?
Magdalena
Telerik team
 answered on 06 Feb 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?