Thursday, November 14, 2013

Common Issues with Rad Grid : telerik Unable to get property 'documentElement' of undefined or null reference

Hi all,

When developing ASP.Net applications using Telerik Controls, you may have come across this error saying "telerik Unable to get property 'documentElement' of undefined or null reference" which will ask you to debug using the javascript debugger. 

I came across this error when working with Telerik Controls in IE 10. When the browser mode is changed to IE 9, the issue fixed.  But this is not good for your Client.

If you are using a Telerik version which is outdated you will face this problem. One thing you can do is to upgrade your Telerik version.

Next you can fix this issue by adding the following lines in your web page. 

<head runat="server">
    <!-- Mimic Internet Explorer 9 -->
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" />
</head>

Another fix that is discussed in various posts in web is to edit the web.config file as follows. (This fix didn’t work for me and I have also seen others who have not been able to fix by editing the web.config file.) Anyway following is the way you can do that.

<system.webServer>

    <httpProtocol>
      <customHeaders>
        <clear />
        <add name="X-UA-Compatible" value="IE=9"/>
      </customHeaders>
    </httpProtocol>
   
</system.webServer>



Start Developing ASP.Net Applications Using Telerik Controls

Hi all,

Today I’m going to show you how to setup the environment to work with Telerik controls in ASP.Net web applications. In a previous tutorial I showed you how to develop a simple grid using Telerik RadGrid. When developing the grid, we have to add the references and edit the web.config file to avoid the errors that come on our way.

First you have to add the reference to “Telerik.Web.UI.dll”.





















Next the web.config should be edited as following. (Note: I have done this to support a basic rad grid and this may change according to your application)
 <configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
   
    <httpHandlers>
      <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />
    </httpHandlers>
    <pages>
      <controls>
        <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI"/>
      </controls>
    </pages>
   
  </system.web>

  <system.webServer>
    <handlers>
      <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource"/>
    </handlers>
  </system.webServer>

  <location path="Telerik.Web.UI.WebResource.axd">
    <system.web>
      <authorization>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>
 
</configuration>

Finally you have to add the  “Telerik.Web.UI.dll” to the bin folder of your project.

Now you can start developing ASP.Net applications using Telerik.


Hope this helps J

Friday, November 8, 2013

Common Issues with Rad Grid : Input string was not in a correct format.

If you get this error "Error: Sys.WebForms.PageRequestManagerServerErrorException: Input string was not in a correct format." when u click on the edit button of your radgrid data item, what you have to do is first check whether the data-format-strings are correct in your grid. I got this error because I have incorrectly configured the data-format-string for the given object's fields.

Hope this helps, thanks :-)