Hi,
How do I set the RadGrid width and height in javascript? I dont know if I am doing this correctly...but here is what i did...
I have a window.onresize function to make the grid fill the whole browser based on the browser size, which is working fine when I use the following function with code as follows:-
"var grid = document.getElementById("<%=Grid.ClientID%>");
grid.style.width = "1000px" <--- calculated based on current window size
grid.style.height = "1000px" etc...."
But, when I call the same function with window.onload, the width is resizing fine...but the grid.style.height is not filling the screen in FIREFOX 3.0. For some reason, the repaint/redraw of the grid is not called?
Is there another way of resizing the grid in javascript besides calling element.style.height/width?
Cheers,
Josh
How do I set the RadGrid width and height in javascript? I dont know if I am doing this correctly...but here is what i did...
I have a window.onresize function to make the grid fill the whole browser based on the browser size, which is working fine when I use the following function with code as follows:-
"var grid = document.getElementById("<%=Grid.ClientID%>");
grid.style.width = "1000px" <--- calculated based on current window size
grid.style.height = "1000px" etc...."
But, when I call the same function with window.onload, the width is resizing fine...but the grid.style.height is not filling the screen in FIREFOX 3.0. For some reason, the repaint/redraw of the grid is not called?
Is there another way of resizing the grid in javascript besides calling element.style.height/width?
Cheers,
Josh
9 Answers, 1 is accepted
0
Hi Josh,
Could you please try setting Radgrid's dimension in the OnGridCreated client event:
Sincerely yours,
Veli
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Could you please try setting Radgrid's dimension in the OnGridCreated client event:
<ClientSettings> |
<ClientEvents OnGridCreated="GridCreated" /> |
</ClientSettings> |
function GridCreated(sender, args) |
{ |
sender.style.width = "1000px" |
sender.style.height = "1000px" |
} |
Sincerely yours,
Veli
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Josh
Top achievements
Rank 1
answered on 07 Jul 2008, 05:28 AM
Hi Veli,
sender.style.width / sender.style.height is invalid, it throws a javascript error.
I have tried using sender.GridDataDiv.style.height / width but wierd things are happening atm... maybe due to the use of static headers, frozen columns and grouping.... like when I set the sender.GridDataDiv.style.width, I need to set the sender.GridHeaderDiv.style.width as well. And I think for the GridDataDiv.style.height, I need to subtract the GridHeaderDiv.style.height or something? as it is overflowing etc...
Also when I set the width/height using GridDataDiv/GridHeaderDiv, my frozen columns stopped working.
Please advice of other possible solutions.
Thank you.
Josh
sender.style.width / sender.style.height is invalid, it throws a javascript error.
I have tried using sender.GridDataDiv.style.height / width but wierd things are happening atm... maybe due to the use of static headers, frozen columns and grouping.... like when I set the sender.GridDataDiv.style.width, I need to set the sender.GridHeaderDiv.style.width as well. And I think for the GridDataDiv.style.height, I need to subtract the GridHeaderDiv.style.height or something? as it is overflowing etc...
Also when I set the width/height using GridDataDiv/GridHeaderDiv, my frozen columns stopped working.
Please advice of other possible solutions.
Thank you.
Josh
0
Hello Josh,
Please try with sender.get_element().style.width to get a reference to the DOM element (div) of RadGrid. Please note that changing RadGrid's layout may not always render the expected results under any browser when complex client-side functionality is used. This is partly due to RadGrid's layout changing method interactions, and partly to the browser rendering mechanisms.
If the problem persists, please consider sending us a sample runnable project attached to a formal support ticket, so that we can have a deeper look to be able to advise you further.
All the best,
Veli
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Please try with sender.get_element().style.width to get a reference to the DOM element (div) of RadGrid. Please note that changing RadGrid's layout may not always render the expected results under any browser when complex client-side functionality is used. This is partly due to RadGrid's layout changing method interactions, and partly to the browser rendering mechanisms.
If the problem persists, please consider sending us a sample runnable project attached to a formal support ticket, so that we can have a deeper look to be able to advise you further.
All the best,
Veli
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Hello Josh,
Please try with sender.get_element().style.width to get a reference to the DOM element (div) of RadGrid. Please note that changing RadGrid's layout may not always render the expected results under any browser when complex client-side functionality is used. This is partly due to RadGrid's layout changing method interactions, and partly to the browser rendering mechanisms.
If the problem persists, please consider sending us a sample runnable project attached to a formal support ticket, so that we can have a deeper look to be able to advise you further.
All the best,
Veli
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Please try with sender.get_element().style.width to get a reference to the DOM element (div) of RadGrid. Please note that changing RadGrid's layout may not always render the expected results under any browser when complex client-side functionality is used. This is partly due to RadGrid's layout changing method interactions, and partly to the browser rendering mechanisms.
If the problem persists, please consider sending us a sample runnable project attached to a formal support ticket, so that we can have a deeper look to be able to advise you further.
All the best,
Veli
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Hello Josh,
Please try with sender.get_element().style.width to get a reference to the DOM element (div) of RadGrid. Please note that changing RadGrid's layout may not always render the expected results under any browser when complex client-side functionality is used. This is partly due to RadGrid's layout changing method interactions, and partly to the browser rendering mechanisms.
If the problem persists, please consider sending us a sample runnable project attached to a formal support ticket, so that we can have a deeper look to be able to advise you further.
All the best,
Veli
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Please try with sender.get_element().style.width to get a reference to the DOM element (div) of RadGrid. Please note that changing RadGrid's layout may not always render the expected results under any browser when complex client-side functionality is used. This is partly due to RadGrid's layout changing method interactions, and partly to the browser rendering mechanisms.
If the problem persists, please consider sending us a sample runnable project attached to a formal support ticket, so that we can have a deeper look to be able to advise you further.
All the best,
Veli
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Hello Josh,
Please try with sender.get_element().style.width to get a reference to the DOM element (div) of RadGrid. Please note that changing RadGrid's layout may not always render the expected results under any browser when complex client-side functionality is used. This is partly due to RadGrid's layout changing method interactions, and partly to the browser rendering mechanisms.
If the problem persists, please consider sending us a sample runnable project attached to a formal support ticket, so that we can have a deeper look to be able to advise you further.
All the best,
Veli
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Please try with sender.get_element().style.width to get a reference to the DOM element (div) of RadGrid. Please note that changing RadGrid's layout may not always render the expected results under any browser when complex client-side functionality is used. This is partly due to RadGrid's layout changing method interactions, and partly to the browser rendering mechanisms.
If the problem persists, please consider sending us a sample runnable project attached to a formal support ticket, so that we can have a deeper look to be able to advise you further.
All the best,
Veli
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Hello Josh,
Please try with sender.get_element().style.width to get a reference to the DOM element (div) of RadGrid. Please note that changing RadGrid's layout may not always render the expected results under any browser when complex client-side functionality is used. This is partly due to RadGrid's layout changing method interactions, and partly to the browser rendering mechanisms.
If the problem persists, please consider sending us a sample runnable project attached to a formal support ticket, so that we can have a deeper look to be able to advise you further.
All the best,
Veli
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Please try with sender.get_element().style.width to get a reference to the DOM element (div) of RadGrid. Please note that changing RadGrid's layout may not always render the expected results under any browser when complex client-side functionality is used. This is partly due to RadGrid's layout changing method interactions, and partly to the browser rendering mechanisms.
If the problem persists, please consider sending us a sample runnable project attached to a formal support ticket, so that we can have a deeper look to be able to advise you further.
All the best,
Veli
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Hello Josh,
Please try with sender.get_element().style.width to get a reference to the DOM element (div) of RadGrid. Please note that changing RadGrid's layout may not always render the expected results under any browser when complex client-side functionality is used. This is partly due to RadGrid's layout changing method interactions, and partly to the browser rendering mechanisms.
If the problem persists, please consider sending us a sample runnable project attached to a formal support ticket, so that we can have a deeper look to be able to advise you further.
All the best,
Veli
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Please try with sender.get_element().style.width to get a reference to the DOM element (div) of RadGrid. Please note that changing RadGrid's layout may not always render the expected results under any browser when complex client-side functionality is used. This is partly due to RadGrid's layout changing method interactions, and partly to the browser rendering mechanisms.
If the problem persists, please consider sending us a sample runnable project attached to a formal support ticket, so that we can have a deeper look to be able to advise you further.
All the best,
Veli
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Accepted
Hello Josh,
Please try with sender.get_element().style.width to get a reference to the DOM element (div) of RadGrid. Please note that changing RadGrid's layout may not always render the expected results under any browser when complex client-side functionality is used. This is partly due to RadGrid's layout changing method interactions, and partly to the browser rendering mechanisms.
If the problem persists, please consider sending us a sample runnable project attached to a formal support ticket, so that we can have a deeper look to be able to advise you further.
All the best,
Veli
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Please try with sender.get_element().style.width to get a reference to the DOM element (div) of RadGrid. Please note that changing RadGrid's layout may not always render the expected results under any browser when complex client-side functionality is used. This is partly due to RadGrid's layout changing method interactions, and partly to the browser rendering mechanisms.
If the problem persists, please consider sending us a sample runnable project attached to a formal support ticket, so that we can have a deeper look to be able to advise you further.
All the best,
Veli
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center