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

Grid Heirarchy not working in Firefox

7 Answers 116 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David Thompson
Top achievements
Rank 2
David Thompson asked on 15 Jul 2010, 03:37 PM
I have recently upgraded to the newest RadGrid control and am still having a problem where the grid will not expand when using Firefox but it works fine in IE 8.  I click on the expand and it does work but never expands.  I am posting my ASPX page below:

<%@ Page Language="C#" MasterPageFile="~/MasterPages/Main.Master" AutoEventWireup="true" CodeBehind="ParameterGrid.aspx.cs" Inherits="NTE.NTEx.Web.App.OptimizationScenarios.ParameterGrid" Title="Parameter" %>
<%@ MasterType TypeName="NTE.NTEx.Web.MainMaster" %>
  
<asp:Content ID="Content1" ContentPlaceHolderID="cphMain" runat="server">
<br />
<center><asp:Label ID="Label1" CssClass="NormalTextBold" runat="server" ></asp:Label></center>
       <telerik:RadGrid ID="RadGrid1" Skin="Web20" runat="server" Width="95%" AutoGenerateColumns="False" 
            OnUpdateCommand="RadGrid1_UpdateCommand"
            OnItemUpdated="RadGrid1_ItemUpdated" BorderStyle="None"
            OnNeedDataSource="RadGrid1_NeedDataSource"
            PageSize="3" AllowSorting="True" AllowMultiRowSelection="True" AllowPaging="False" GridLines="Horizontal" ShowStatusBar="true">
            <PagerStyle Mode="NumericPages"></PagerStyle>
            <ClientSettings AllowExpandCollapse="True">
            </ClientSettings
            <MasterTableView DataKeyNames="CategoryName" AllowMultiColumnSorting="True"
                HierarchyLoadMode="Client" Width="100%" HierarchyDefaultExpanded="False">
                <DetailTables>
                    <telerik:GridTableView DataKeyNames="ParameterId" Width="100%" EditMode="InPlace">
                        <ParentTableRelation>
                            <telerik:GridRelationFields DetailKeyField="CategoryName" MasterKeyField="CategoryName" />
                        </ParentTableRelation>
                        <Columns>
                            <telerik:GridEditCommandColumn UniqueName="EditCommandColumn"></telerik:GridEditCommandColumn>
                            <telerik:GridBoundColumn UniqueName="ParameterId" Visible="false" DataField="ParameterId">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="ParameterName" ReadOnly="true" HeaderText="Name" HeaderButtonType="TextButton"
                                DataField="ParameterName">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="ParameterDescription" ReadOnly="true" HeaderText="Description" HeaderButtonType="TextButton"
                                DataField="ParameterDescription">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="DefaultValue" HeaderText="Default" ReadOnly="true" Visible="true" DataField="Initial_value"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="MinimumValue" HeaderText="Minimum" ReadOnly="true" Visible="true" DataField="Minimum_value" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" ></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="ParameterValue" HeaderText="Value" HeaderButtonType="TextButton"
                                DataField="ParameterValue" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="NormalTextBold" >
                            </telerik:GridBoundColumn
                            <telerik:GridBoundColumn UniqueName="MaximumValue" HeaderText="Maximum" ReadOnly="true" Visible="true" DataField="Maximum_value" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"></telerik:GridBoundColumn>
                       </Columns>
                        <SortExpressions>
                            <telerik:GridSortExpression FieldName="ParameterName"></telerik:GridSortExpression>
                        </SortExpressions>
                         <EditFormSettings ColumnNumber="1" CaptionFormatString="Edit details for optimization scenario with ID {0}"
                                CaptionDataField="ID">
                            <FormTableItemStyle Wrap="True"></FormTableItemStyle>
                            <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
                            <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" Width="100%" />
                            <FormTableStyle GridLines="Horizontal" CellSpacing="0" CellPadding="2" CssClass="module" Height="110px" Width="100%" />
                            <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                            <FormStyle Width="100%" BackColor="#eef2ea"></FormStyle>
                            <EditColumn UpdateText="Update record" UniqueName="EditCommandColumn1" CancelText="Cancel edit"></EditColumn>
                            <FormTableButtonRowStyle HorizontalAlign="Left" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
                        </EditFormSettings>
                   </telerik:GridTableView>
                </DetailTables>
                <Columns>
                    <telerik:GridBoundColumn UniqueName="CategoryName" HeaderText="Category" HeaderButtonType="TextButton"
                        DataField="CategoryName">
                    </telerik:GridBoundColumn>
                </Columns>
                <SortExpressions>
                    <telerik:GridSortExpression FieldName="CategoryName"></telerik:GridSortExpression>
                </SortExpressions>
            </MasterTableView>
        </telerik:RadGrid>
</asp:Content>

7 Answers, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 20 Jul 2010, 01:00 PM
Hello David,

When the hierarchical RadGrid is bound into the NeedDataSource event you do not have to set the ParentTableRelations between MasterTable and detail tables. The ParentTableRelations is used when the grid has hierarchical data-binding using declarative relations . Please check out the following online documentation article which explains Hierarchical data-binding using DetailTableDataBind event:
 http://www.telerik.com/help/aspnet-ajax/grdhierarchicaldatabindingusingdetailtabledatabind.html
Please give it try and let me know if the issue still persists.   

Sincerely yours,
Radoslav
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
David Thompson
Top achievements
Rank 2
answered on 29 Jul 2010, 05:23 PM
That is strang that it works fine for IE that way...

I tried to get to your second link but it gives me a 500 error.
0
David Thompson
Top achievements
Rank 2
answered on 30 Jul 2010, 12:01 AM
Ok.  That makes alot of scense and I made this change to my routines and the IE version is still working great but I still do not get any activity on the Firefox.  When I click on the arrow to expand a column, it thinks about it for a while, and returns back to the screen with nothing expanded at all.  It seems to be doing a postback but returns as if we just loaded the page.  Since your link did not work, I searched for another one dealing with DetalTableDataBind even.  I did the same things as your example:

http://demos.telerik.com/aspnet-ajax/grid/examples/programming/detailtabledatabind/defaultcs.aspx

Here is my code:
protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
    if (!e.IsFromDetailTable)
    {
        LoadParent();
    }
}
  
private void LoadParent()
{
    StringBuilder strSQL = new StringBuilder();
    //Category Query
    DbParams parameters = new DbParams();
    strSQL.Append("SELECT distinct a.Category_Name CategoryName ");
    strSQL.Append(" FROM OPTIMIZER_PARAMETERS a, PLAN_SCENARIO_PARAMETERS b");
    strSQL.Append(" WHERE a.id = b.optimizer_parameter_id ");
    if (string.IsNullOrEmpty(Data["PlanScenarioID"]) == false)
    {
        strSQL.Append(" AND b.PLAN_SCENARIO_ID = TO_NUMBER(:1)");
        parameters.Add("1", Data["PlanScenarioID"]);
    }
    DataSet ds = DataHelper.FetchData(strSQL.ToString(), parameters);
    RadGrid1.AutoGenerateColumns = false;
    RadGrid1.DataSource = ds.Tables[0];
    RadGrid1.MasterTableView.EditMode = GridEditMode.InPlace;
    RadGrid1.MasterTableView.DataSource = ds.Tables[0];
    //Query XML
}
protected void RadGrid1_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
{
    GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
    switch (e.DetailTableView.Name)
    {
        case "Parms":
            {
                DbParams parameters = new DbParams();
                StringBuilder strSQL = new StringBuilder();
                strSQL.Append("SELECT a.id ParameterId, a.category_name CategoryName, a.name ParameterName, a.description ParameterDescription, b.PARAMETER_VALUE ParameterValue, a.minimum_value, a.maximum_value, a.Initial_value");
                strSQL.Append(" FROM OPTIMIZER_PARAMETERS a, PLAN_SCENARIO_PARAMETERS b");
                strSQL.Append(" WHERE a.id = b.optimizer_parameter_id ");
                if (string.IsNullOrEmpty(Data["PlanScenarioID"]) == false)
                {
                    strSQL.Append(" AND b.PLAN_SCENARIO_ID = TO_NUMBER(:1)");
                    parameters.Add("1", Data["PlanScenarioID"]);
                }
                strSQL.Append(" AND a.category_name = :2");
                parameters.Add("2", dataItem.GetDataKeyValue("CategoryName").ToString());
                DataSet ds = DataHelper.FetchData(strSQL.ToString(), parameters);
                e.DetailTableView.DataSource = ds.Tables[0];
                break;
            }
    }
}
0
David Thompson
Top achievements
Rank 2
answered on 30 Jul 2010, 04:04 PM
I wonder if my issues is because I am using items in the master page.  Let me pass that on to you as well.

Here is the master page ASPX logic:
<%@ Master Language="C#" AutoEventWireup="true" Codebehind="Main.master.cs" Inherits="NTE.NTEx.Web.MainMaster" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head id="Head1" runat="server">
    <title>NTE</title>
    <script type="text/javascript" language="JavaScript">
       function FreezeScreen(msg) {
          scroll(0,0);
          var outerPane = document.getElementById('FreezePane');
          var innerPane = document.getElementById('InnerFreezePane');
          if (outerPane) outerPane.className = 'FreezePaneOn';
          if (innerPane) innerPane.innerHTML = msg;
       }
    </script>
</head>
<body class="bodybg">
<%-- %><form id="Form1" runat="server" onsubmit="FreezeScreen('Submitting...');return true;">--%>
<form id="frm" runat="server">
    <asp:ScriptManager runat="server" ID="smAjax" EnablePartialRendering="true" />
    <asp:Literal ID="ltlBroadcastMessage" runat="server" Visible="false"></asp:Literal>
    <table border="0" cellspacing="0" cellpadding="0" class="MaxWidth">
        <tr class="LogoRow">
            <td><asp:Image runat="server" ImageUrl="~/Public/images/invisible.gif" Height="14" /></td>
        </tr>
        <tr class="LogoRow">
            <td align="left" style="padding-left:12px;"><asp:HyperLink ID="LogoURL" runat="server"><div class="MainLogoImage"></div></asp:HyperLink></td>
        </tr>
    </table>
    <asp:PlaceHolder ID="phTopBar" runat="server"></asp:PlaceHolder>
    <nte:TopBarLinks runat="server" EnableTheming="true" Visible="false" ID="TopBarLinks" />
    <nte:TopBarnoLinks runat="server" EnableTheming="true" Visible="false" ID="TopBarnoLinks" />
    <table border="0" cellspacing="0" cellpadding="0" class="ContentTable MaxWidth">
        <tr>
            <td class="NormalText" style="height: 8px"><asp:Image ID="Image1" runat="server" ImageUrl="~/Public/images/invisible.gif" Height="8" /></td>
        </tr>
        <tr>
            <td class="NormalText" valign="top">
                <!-- End Header -->
                <asp:Label runat="server" ID="lblPageTitle" CssClass="pageTitle" />
                <nte:MessageBox runat="server" ID="msgBox" />
                <nte:MessageDisplay runat="server" ID="msgDisplay" />
                <asp:ContentPlaceHolder ID="cphMain" runat="server"></asp:ContentPlaceHolder>
                <!-- Start Footer -->
            </td>
        </tr>
        <tr>
            <td class="NormalText"><asp:Image ID="Image2" runat="server" ImageUrl="~/Public/images/invisible.gif" Height="8" /></td>
        </tr>
    </table>
    <table border="0" cellspacing="0" cellpadding="0" class="MaxWidth">
        <tr class="BottomBar">
            <td class="BottomBar" valign="middle"><div class="FooterImage"></div></td>
        </tr>
        <tr align="center">
            <td class="SmallText"><asp:Literal ID="Footer" runat="server"></asp:Literal></td>
        </tr>
        <tr>
            <td class="NormalText"> </td>
        </tr>
    </table>
</form>
<div style="text-align:center" id="FreezePane" class="FreezePaneOff">
   <div id="InnerFreezePane" class="InnerFreezePane"> </div>
</div>
</body>
</html>

Here is the Page ASPX logic:

<%@ Page Language="C#" MasterPageFile="~/MasterPages/Main.Master" AutoEventWireup="true" CodeBehind="ParameterGrid.aspx.cs" Inherits="NTE.NTEx.Web.App.OptimizationScenarios.ParameterGrid" Title="Parameter" %>
<%@ MasterType TypeName="NTE.NTEx.Web.MainMaster" %>
  
<asp:Content ID="Content1" ContentPlaceHolderID="cphMain" runat="server">
<br />
<center><asp:Label ID="Label1" CssClass="NormalTextBold" runat="server" ></asp:Label></center>
       <telerik:RadGrid ID="RadGrid1" Skin="Web20" runat="server" Width="95%" AutoGenerateColumns="False" 
            OnUpdateCommand="RadGrid1_UpdateCommand"
            OnItemUpdated="RadGrid1_ItemUpdated" BorderStyle="None"
            OnNeedDataSource="RadGrid1_NeedDataSource"
            OnDetailTableDataBind="RadGrid1_DetailTableDataBind" 
            PageSize="3" AllowSorting="True" AllowMultiRowSelection="True" AllowPaging="False" GridLines="Horizontal" ShowStatusBar="true">
            <PagerStyle Mode="NumericPages"></PagerStyle>
            <MasterTableView DataKeyNames="CategoryName" AllowMultiColumnSorting="True"
                HierarchyLoadMode="Client" Width="100%" HierarchyDefaultExpanded="False">
                <DetailTables>
                    <telerik:GridTableView DataKeyNames="ParameterId" Name="Parms" Width="100%" EditMode="InPlace">
                        <Columns>
                            <telerik:GridEditCommandColumn UniqueName="EditCommandColumn"></telerik:GridEditCommandColumn>
                            <telerik:GridBoundColumn UniqueName="ParameterId" Visible="false" DataField="ParameterId">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="ParameterName" ReadOnly="true" HeaderText="Name" HeaderButtonType="TextButton"
                                DataField="ParameterName">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="ParameterDescription" ReadOnly="true" HeaderText="Description" HeaderButtonType="TextButton"
                                DataField="ParameterDescription">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="DefaultValue" HeaderText="Default" ReadOnly="true" Visible="true" DataField="Initial_value"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="MinimumValue" HeaderText="Minimum" ReadOnly="true" Visible="true" DataField="Minimum_value" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" ></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="ParameterValue" HeaderText="Value" HeaderButtonType="TextButton"
                                DataField="ParameterValue" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" ItemStyle-CssClass="NormalTextBold" >
                            </telerik:GridBoundColumn
                            <telerik:GridBoundColumn UniqueName="MaximumValue" HeaderText="Maximum" ReadOnly="true" Visible="true" DataField="Maximum_value" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"></telerik:GridBoundColumn>
                       </Columns>
                        <SortExpressions>
                            <telerik:GridSortExpression FieldName="ParameterName"></telerik:GridSortExpression>
                        </SortExpressions>
                         <EditFormSettings ColumnNumber="1" CaptionFormatString="Edit details for optimization scenario with ID {0}"
                                CaptionDataField="ID">
                            <FormTableItemStyle Wrap="True"></FormTableItemStyle>
                            <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
                            <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" Width="100%" />
                            <FormTableStyle GridLines="Horizontal" CellSpacing="0" CellPadding="2" CssClass="module" Height="110px" Width="100%" />
                            <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                            <FormStyle Width="100%" BackColor="#eef2ea"></FormStyle>
                            <EditColumn UpdateText="Update record" UniqueName="EditCommandColumn1" CancelText="Cancel edit"></EditColumn>
                            <FormTableButtonRowStyle HorizontalAlign="Left" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
                        </EditFormSettings>
                   </telerik:GridTableView>
                </DetailTables>
                <Columns>
                    <telerik:GridBoundColumn UniqueName="CategoryName" HeaderText="Category" HeaderButtonType="TextButton"
                        DataField="CategoryName">
                    </telerik:GridBoundColumn>
                </Columns>
                <SortExpressions>
                    <telerik:GridSortExpression FieldName="CategoryName"></telerik:GridSortExpression>
                </SortExpressions>
            </MasterTableView>
        </telerik:RadGrid>
</asp:Content>
0
Radoslav
Telerik team
answered on 03 Aug 2010, 12:47 PM
Hi David,

I tried to reproduce the described issue, but to no avail. I am sending you a simple example which demonstrates the desired functionality. Please check it out and let me know if it helps you. Additionally it will be helpful if you send us a simple runnable example demonstrating the problem. You could open a formal support ticket from your Telerik account and attach a ZIP file there. In that way we can reproduce and pinpoint the problems you're facing on our side, understand the logic of your application and provide a solution.

Kind regards,
Radoslav
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
David Thompson
Top achievements
Rank 2
answered on 04 Aug 2010, 10:16 PM
Ok I think I am getting closer. I added your example into my project and it stops working.  The problem seems to be that the first time we try to expand the highest level in the heirarchy, it does nothing.  But once I force a postback (expand a lower level, go to another page, or click an inline edit) it then magically works for the higher levels!   To prove this, I set my original page to be initially expanded, clicked on the EDIT and then CANCEL and then I was able to contract all the first levels at will.  It seems that this has nothing to do with the script manager or master page as I have tried to make mine look just like yours and I get nothing.

So, in summary, it seems that the first non-postback (client side) event is not firing, or is firing but doing nothing.

Any ideas?

P.S. We have built a large infrastructure with Oracle stored procedures called upon connection so there is really no way I can par this down to send you something.
0
Radoslav
Telerik team
answered on 10 Aug 2010, 07:51 AM
Hi David,

It is hard to say what is causing the described issue without having the running application and reproduce the issue. Could you please try modifying the example which I sent you and send it back to us. You could open a formal support ticket from your Telerik account and attach a ZIP file there. Thus we will be able to we debug the project and provide you with more to-the-point answer.

Looking forward for your reply.

Regards,
Radoslav
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
Tags
Grid
Asked by
David Thompson
Top achievements
Rank 2
Answers by
Radoslav
Telerik team
David Thompson
Top achievements
Rank 2
Share this question
or