Hi
I am trying to use the javascript function as given in "Changing grid ScrollHeight at runtime to fill its container height"
I am getting an error that "GridDatDiv" is null or not an object".
Can you help?
The script is given below.
I am trying to use the javascript function as given in "Changing grid ScrollHeight at runtime to fill its container height"
I am getting an error that "GridDatDiv" is null or not an object".
Can you help?
The script is given below.
function
GridCreated(sender, args)
{
var scrollArea = sender.GridDataDiv;
var parent = $get("gridContainer");
var gridHeader = sender.GridHeaderDiv;
scrollArea.style.height = parent.clientHeight - gridHeader.clientHeight +
"px";
}
11 Answers, 1 is accepted
0
Princy
Top achievements
Rank 2
answered on 07 May 2008, 12:44 PM
Hi Jubith,
Which version of the Grid are you using? Try upgrading to Q1 2008.
Updating RadControls for ASP.NET to another version or license
Princy.
Which version of the Grid are you using? Try upgrading to Q1 2008.
Updating RadControls for ASP.NET to another version or license
Princy.
0
Jubith
Top achievements
Rank 1
answered on 07 May 2008, 12:54 PM
Thanks for the mail Princy
Better still can you update me on what should i do for customizing the height of the grid?
Regards
JN
Better still can you update me on what should i do for customizing the height of the grid?
Regards
JN
0
Princy
Top achievements
Rank 2
answered on 08 May 2008, 07:13 AM
Hi,
Try setting the Grid height in the aspx as shown below.
ASPX:
Thanks
Princy.
Try setting the Grid height in the aspx as shown below.
ASPX:
| <telerik:RadGrid ID="RadGrid1" runat="server" Height="500px" > |
Thanks
Princy.
0
Jubith
Top achievements
Rank 1
answered on 08 May 2008, 07:41 AM
Princy
<telerik:RadGrid ID="RadGrid1" runat="server" Height="500px" >
is something i would not want to do.
What i am talking about here is setting the height explicitly. That is it needs to show 10 records together. And there should be no scroll bar. When it goes to the next page which has just the 11th record, the height need to shrink and the pagination needs to come immediately after the 11th record. (If there is a 12th record, pagination will come after 12th.) Dont mind a scroll bar if the 11/12 records are shown together.
Now, when we click on add, show filter or edit modes, The height increases, But a scroll bar is not desired. As the records still are 10. Which means that the height need to adjust accordingly.
Can you help?
Thanks in advacne.
JN
<telerik:RadGrid ID="RadGrid1" runat="server" Height="500px" >
is something i would not want to do.
What i am talking about here is setting the height explicitly. That is it needs to show 10 records together. And there should be no scroll bar. When it goes to the next page which has just the 11th record, the height need to shrink and the pagination needs to come immediately after the 11th record. (If there is a 12th record, pagination will come after 12th.) Dont mind a scroll bar if the 11/12 records are shown together.
Now, when we click on add, show filter or edit modes, The height increases, But a scroll bar is not desired. As the records still are 10. Which means that the height need to adjust accordingly.
Can you help?
Thanks in advacne.
JN
0
ChrisS
Top achievements
Rank 1
answered on 22 May 2008, 09:01 PM
Not sure whether this is exactly what you want to do but you can set the height of the radgrid via:
Let me know if this has answered your question.
| var companyGrid = $find("<%= rgCompany.ClientID %>") |
| companyGrid.GridDataDiv.style.height = 400; |
Let me know if this has answered your question.
0
Prabhu
Top achievements
Rank 1
answered on 23 May 2008, 06:28 AM
Can you explain it a bit more?
Whast "rgCompany.ClientID"?
Is rgCompany a name assumed for the Grid? If so, whats GridDataDiv?
Whast "rgCompany.ClientID"?
Is rgCompany a name assumed for the Grid? If so, whats GridDataDiv?
0
Shinu
Top achievements
Rank 2
answered on 23 May 2008, 06:34 AM
Hi Prabhu,
Have a look at the following help document links.
Getting RadGrid client object
Changing grid ScrollHeight at runtime to fill its container height
Shinu.
Have a look at the following help document links.
Getting RadGrid client object
Changing grid ScrollHeight at runtime to fill its container height
Shinu.
0
ChrisS
Top achievements
Rank 1
answered on 23 May 2008, 08:44 AM
rgCompany is the name of the RadGrid.
No idea what GridDataDiv is. It is explained a bit more here (as mentioned in the previous post).
http://www.telerik.com/help/aspnet-ajax/grdchangescrollheightatruntime.html
All I know is that:
companyGrid.GridDataDiv.style.height = 400; allowed me to change the height of my Grid!
No idea what GridDataDiv is. It is explained a bit more here (as mentioned in the previous post).
http://www.telerik.com/help/aspnet-ajax/grdchangescrollheightatruntime.html
All I know is that:
companyGrid.GridDataDiv.style.height = 400; allowed me to change the height of my Grid!
0
Prabhu
Top achievements
Rank 1
answered on 23 May 2008, 10:25 AM
Shinu
IN the link you have send, it says "In the GridCreated event handler, use the grid's GridDataDiv property to obtain a reference to the DOM element for the grid's scrollable region."
How do i do this? The grid i am using does not seem to have this property at all!
Jubith Nambradth
IN the link you have send, it says "In the GridCreated event handler, use the grid's GridDataDiv property to obtain a reference to the DOM element for the grid's scrollable region."
How do i do this? The grid i am using does not seem to have this property at all!
Jubith Nambradth
0
Shinu
Top achievements
Rank 2
answered on 23 May 2008, 11:02 AM
Hi Jubith,
Which version of the Grid are you using?
Shinu.
Which version of the Grid are you using?
Shinu.
0
Prabhu
Top achievements
Rank 1
answered on 23 May 2008, 11:06 AM
4.5.2