Piotr Szmyd
Top achievements
Rank 1
Piotr Szmyd
asked on 20 Jun 2008, 12:52 PM
Hi,
I have a page using RadSplitter and RadGrids inside it (with static headers and scrolling). RadSplitter expands to 100% width and height and so grids do. After upgrade to SP2 page stopped to load and throws Javascript error. I debugged JS code and found out which part throws an error (Invalid argument) - i marked it in bold:
(...)
setTimeout("Telerik.Web.UI.Grid.frozenScrollHanlder("+this._frozenScrollCounter+")",0);
I have a page using RadSplitter and RadGrids inside it (with static headers and scrolling). RadSplitter expands to 100% width and height and so grids do. After upgrade to SP2 page stopped to load and throws Javascript error. I debugged JS code and found out which part throws an error (Invalid argument) - i marked it in bold:
(...)
setTimeout("Telerik.Web.UI.Grid.frozenScrollHanlder("+this._frozenScrollCounter+")",0);
},onWindowResize:
function(){
this
.setHeaderAndFooterDivsWidth();
this
.setDataDivHeight();
},setHeaderAndFooterDivsWidth:
function(){
if
(this._owner.GridDataDiv&&this._owner.GridHeaderDiv){
if
(navigator.userAgent.toLowerCase().indexOf("msie")!=-1){
if
(this._owner.GridDataDiv.offsetWidth>0){
this
._owner.GridHeaderDiv.style.width=this._owner.GridDataDiv.offsetWidth-Telerik.Web.UI.Grid.getScrollBarHeight()+"px";
}
(...)
Regards,
Piotr
5 Answers, 1 is accepted
0
Hi Piotr Szmyd,
May I ask for a sample code, please? Unfortunately, my attempts to reproduce the problem following your scenario fail so far.
If you can isolate that in a simple runnable application, please send it trough a regular support ticket. We will gladly review it and get back to you with our findings/resolution. Thank you in advance!
All the best,
Konstantin Petkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
May I ask for a sample code, please? Unfortunately, my attempts to reproduce the problem following your scenario fail so far.
If you can isolate that in a simple runnable application, please send it trough a regular support ticket. We will gladly review it and get back to you with our findings/resolution. Thank you in advance!
All the best,
Konstantin Petkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Piotr Szmyd
Top achievements
Rank 1
answered on 20 Jun 2008, 01:53 PM
Hi,
Unfortunately I think it would be very hard to make the page simpler (it's so complex). I wasn't able to reproduce error on a simple page with RadSplitter and RadGrid (so I assume that this is not the point).
I can provide credentials to a test account (page is a part of a greater system), where you can see this page in action.
Could you please look at the code I provided? What can be a possible cause of "Invalid argument" thrown in the line I highlighted? I don't know the object hierarchy of a rendered RadGrid.
I assume that either
this._owner.GridDataDiv.offsetWidth
or
Telerik.Web.UI.Grid.getScrollBarHeight()
returns some invalid data (maybe undefined). But reading the line higher I notice, that
this._owner.GridDataDiv.offsetWidth > 0, so the only point where the error could have originated is Telerik.Web.UI.Grid.getScrollBarHeight(). I think there's a bug in this function.
Could you please track, when this value can be erroneous?
Regards,
Piotr
Unfortunately I think it would be very hard to make the page simpler (it's so complex). I wasn't able to reproduce error on a simple page with RadSplitter and RadGrid (so I assume that this is not the point).
I can provide credentials to a test account (page is a part of a greater system), where you can see this page in action.
Could you please look at the code I provided? What can be a possible cause of "Invalid argument" thrown in the line I highlighted? I don't know the object hierarchy of a rendered RadGrid.
I assume that either
this._owner.GridDataDiv.offsetWidth
or
Telerik.Web.UI.Grid.getScrollBarHeight()
returns some invalid data (maybe undefined). But reading the line higher I notice, that
this._owner.GridDataDiv.offsetWidth > 0, so the only point where the error could have originated is Telerik.Web.UI.Grid.getScrollBarHeight(). I think there's a bug in this function.
Could you please track, when this value can be erroneous?
Regards,
Piotr
0
Piotr Szmyd
Top achievements
Rank 1
answered on 20 Jun 2008, 02:23 PM
I found out that the problem is related to global ItemTemplate within MasterTableView.
When you have some columns defined (I have one TemplateColumn in my columns' list) AND also the global ItemTemplate defined + scrolling and static headers on then the situation happens.
Maybe this can help You reproduce the problem.
Regards,
Piotr
When you have some columns defined (I have one TemplateColumn in my columns' list) AND also the global ItemTemplate defined + scrolling and static headers on then the situation happens.
Maybe this can help You reproduce the problem.
Regards,
Piotr
0
Piotr Szmyd
Top achievements
Rank 1
answered on 20 Jun 2008, 02:37 PM
Setting the one and only TemplateColumn Display property to False solved the problem.
I wonder whether it is a bug or not? When using global ItemTemplate other columns shouldn't be rendered at all, I think.
I found out another problem - when using global ItemTemplate I need to have at least one column defined in order to render items in RadGrid. Is this a normal behavior? When I removed the column (and had no columns defined, only a global ItemTemplate) the items didn't render at all - RadGrid shown "no records" information.
And second thing - why there's still no designer support for global ItemTemplate?
Regards,
Piotr
I wonder whether it is a bug or not? When using global ItemTemplate other columns shouldn't be rendered at all, I think.
I found out another problem - when using global ItemTemplate I need to have at least one column defined in order to render items in RadGrid. Is this a normal behavior? When I removed the column (and had no columns defined, only a global ItemTemplate) the items didn't render at all - RadGrid shown "no records" information.
And second thing - why there's still no designer support for global ItemTemplate?
Regards,
Piotr
0
Hello Piotr,
Have you checked if the AutoGeneratedColumns is enabled? If so, you don't need to declare any columns in order to show the detail tables template. Here is an example:
As you can see, there are no columns and a NestedViewTemplate defined. This example functions properly on my end. I hope this helps!
As to the design-time support, we will definitely add such in a future version of the product. Thank you for your feedback!
Best wishes,
Konstantin Petkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Have you checked if the AutoGeneratedColumns is enabled? If so, you don't need to declare any columns in order to show the detail tables template. Here is an example:
| <telerik:RadGrid ID="RadGrid1" Skin="Sunset" ShowStatusBar="true" DataSourceID="SqlDataSource1" |
| runat="server" AutoGenerateColumns="True" AllowSorting="True" AllowMultiRowSelection="False" |
| AllowPaging="True" GridLines="None"> |
| <PagerStyle Mode="NumericPages"></PagerStyle> |
| <MasterTableView Width="100%" DataSourceID="SqlDataSource1" DataKeyNames="CustomerID" |
| AllowMultiColumnSorting="True"> |
| <NestedViewTemplate> |
| <fieldset style="padding:10px;"> |
| <legend style="padding:5px;"><b>Orders for contact name:</b> |
| <asp:Label ID="Label1" Font-Bold="true" Font-Italic="true" Text='<%# Eval("CustomerID") %>' Visible="false" runat="server" /> |
| <asp:Label ID="Label2" Font-Bold="true" Font-Italic="true" Text='<%# Eval("ContactName") %>' runat="server" /> |
| </legend> |
| <asp:SqlDataSource ID="DetailsDataSource" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" |
| ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM Orders Where CustomerID = @CustomerID" |
| runat="server"> |
| <SelectParameters> |
| <asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="String" Name="CustomerID" /> |
| </SelectParameters> |
| </asp:SqlDataSource> |
| <asp:DetailsView ID="DetailsView1" AllowPaging="true" GridLines="None" Width="100%" DataSourceID="DetailsDataSource" |
| runat="server"> |
| </asp:DetailsView> |
| </fieldset> |
| </NestedViewTemplate> |
| <SortExpressions> |
| <telerik:GridSortExpression FieldName="CompanyName"></telerik:GridSortExpression> |
| </SortExpressions> |
| </MasterTableView> |
| </telerik:RadGrid> |
| <asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" |
| ProviderName="System.Data.SqlClient" SelectCommand="SELECT Top 10 CustomerID, ContactName, CompanyName FROM Customers" runat="server"></asp:SqlDataSource> |
As you can see, there are no columns and a NestedViewTemplate defined. This example functions properly on my end. I hope this helps!
As to the design-time support, we will definitely add such in a future version of the product. Thank you for your feedback!
Best wishes,
Konstantin Petkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center