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

Grid height not properly set and Javascript error

2 Answers 80 Views
This is a migrated thread and some comments may be shown as answers.
Maarten Bos
Top achievements
Rank 1
Maarten Bos asked on 25 Aug 2010, 01:10 PM
Hey all

On a webpage (see attachment*) with a RadGrid and a handfull of other Telerik controls we get some pretty odd behaviour which, however, can be reproduced time and again.
* uploading attachment doesnt seem to work, see here for the picture

When the page is loaded for the first time with the table hidden and after a partial (UpdatePanel) postback is initiated the control is shown with data but the height goes wrong and in IE we are able to see a JavaScript error (shown below).
The strange thing is that the main RadGrid div is properly set to the height of 450px but the rgDataDiv is somehow set to 300px (and no this is not done in code, css or javascript by any custom coding).
We use similar code on 3 more similar pages following the same scenario but these show no error and renders the grid with a total of 450px height and the rgDataDiv gets an 392px height which makes it fit perfectly.

Sys.ArgumentUndefinedException: Value cannot be undefined.
Parameter name: type  ScriptResource.axd?d=vUoTpDxDbR3vJWc5PDPuLYP64nfdrWbf-K52duDrCOVUeQueTMBQzu_1dzOmybqNDuWGBU4UdD1duqTGm1ioStXKKocFu18wOuSUO_RD3MM1&t=ffffffffec2d9970, line 2705 character 12
In function;
var $create = Sys.Component.create = function Sys$Component$create(type, properties, events, references, element) {
In file;
// Name:        MicrosoftAjax.debug.js
// Assembly:    System.Web.Extensions
// Version:
// FileVersion: 3.5.30729.4926

When viewing the source of the rendered HTML all $create calls are related to Telerik controls (hence the post on this forum). And i see about a dozen of these:
Sys.Application.add_init(function() {
    "_originalValue":"16-10-2009 0:00:00",
    "styles":{HoveredStyle: ["width:100%;",
    "riTextBox riHover"],InvalidStyle: ["width:100%;",
    "riTextBox riError"],DisabledStyle: ["width:100%;",
    "riTextBox riDisabled"],FocusedStyle: ["width:100%;",
    "riTextBox riFocused"],EmptyMessageStyle: ["width:100%;",
    "riTextBox riEmpty"],ReadOnlyStyle: ["width:100%;",
    "riTextBox riRead"],EnabledStyle: ["width:100%;",
    "riTextBox riEnabled"]}},

Sofar i've also tried to add some custom Javascript code to the ClientEvents OnGridCreated but this script does not appear to get executed at all.
var radGridByClass = $('.rgDataDiv');
if (radGridByClass.length == 0) return;
var radGridID = radGridByClass[0].id;                              
var radGrid = document.getElementById(radGridID);
var mainheight = $('.RadGrid').height();
var gridHeaderheight = $('.rgHeaderDiv').height(); = mainheight - gridHeaderheight + 'px';

Now this isn't the prettiest code but when i execute it directly in the browser from a Firebug Console it works.

Any help is very much welcome :)

Kind regards,

Maarten Bos

Environment details;
Sharepoint 2010, ASP.Net 3.5, Telerik Ajax controls 2010.1.519.35

2 Answers, 1 is accepted

Sort by
Iana Tsolova
Telerik team
answered on 30 Aug 2010, 03:06 PM
Hello Maarten,

I suggest that you try setting the grid ScrollHeight property as described here and see if it makes any difference.

You also mentioned that the grid is initially invisible. Is this achieved by setting its Visible property to false, or the grid is in container with display:none style?

Sincerely yours,
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Top achievements
Rank 1
answered on 08 Sep 2010, 04:41 PM
We've opted to remove the filtering functionality from this release because of the issues above.  This question is no longer active.
Asked by
Maarten Bos
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Top achievements
Rank 1
Share this question