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

Grid height not properly set and Javascript error

2 Answers 75 Views
Grid
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.

Error;
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:     3.5.0.0
// 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() {
    $create(Telerik.Web.UI.RadDateInput,
    {"_focused":false,
    "_originalValue":"16-10-2009 0:00:00",
    "_postBackEventReferenceScript":"__doPostBack(\u0027ctl00$ctl18$g_729422f7_feb9_4651_91f8_ddbfeff99049$ctl00$historicalSelectionDateFromPicker\u0027,\u0027\u0027)",
    "clientStateFieldID":"ctl00_ctl18_g_729422f7_feb9_4651_91f8_ddbfeff99049_ctl00_historicalSelectionDateFromPicker_dateInput_ClientState",
*snip* 
    "incrementSettings":{InterceptArrowKeys:true,InterceptMouseWheel:true,Step:1},
    "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"]}},
    {"error":DateError,
    "keyPress":ClearError},
    null,
    $get("ctl00_ctl18_g_729422f7_feb9_4651_91f8_ddbfeff99049_ctl00_historicalSelectionDateFromPicker_dateInput"));
});


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();
radGrid.style.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
0
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,
Iana
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
0
Daniel
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.
Tags
Grid
Asked by
Maarten Bos
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Daniel
Top achievements
Rank 1
Share this question
or