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

Grid null at window load

1 Answer 60 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jocelyn
Top achievements
Rank 1
Jocelyn asked on 22 Mar 2012, 06:41 PM
Hi,

I resize my grid when the window load. It works well for every browser except Internet Explorer. The grid is always "null".

I tried what they say in this thread, but this is not working, so I guess I got something different.

Here is my code (jQuery):

$(window).load(function()
{
    Resize();
 
    $(window).resize(function()
    {
        Resize();
    });
});
 
function Resize()
 {
    var grid = $find("<%= mygrid.ClientID %>");
    if (grid != null)
    {
        grid.get_element().style.height = $("#form1").height() + "px";
        grid.repaint();
    }
 }

What am I missing?

I don't want to use pageLoad because it fire before Pictures are load, that's why I'm using $(window).load().

Thanks

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 28 Mar 2012, 10:31 AM
Hello Jocelyn,

I have examined the provided code and it is working properly(the grid is not null). I am attaching my test project to this message. Give it a try and let me know if it helps to resolve the problem you are facing.

Kind regards,
Pavlina
the Telerik team
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
Jocelyn
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or