extra line on radgrid header

8 posts, 0 answers
  1. JJ
    JJ avatar
    147 posts
    Member since:
    May 2010

    Posted 13 Jun 2012 Link to this post

    This message is for Princy,


    I trid to repley
    http://www.telerik.com/community/forums/aspnet-ajax/grid/extra-line-on-radgrid-header.aspx

    But system error not allow me to submit.

    Princy,

    I treid below, while Scrolling AllowScroll="true" UseStaticHeaders="true" , when use

     

    EnableHeaderContextMenu="true"  and hide columns, still leave white space at the end of the column although I used onColumnHidden javascript.

    <ClientSettings>onColumnHidden
            <ClientEvents OnColumnHidden="onColumnHidden" />
            <Scrolling AllowScroll="true" UseStaticHeaders="true" />
    </ClientSettings>

    If you have a working sample for the situation Scrolling AllowScroll="true" UseStaticHeaders="true", can you send it to me?

    Thanks
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 14 Jun 2012 Link to this post

    Hi,

    Are you still getting the extra line on RadGrid Header? I tried the same code from the demo link you have given. I could replicate the issue when i set the AllowScroll and UseStaticHeaders to true.Here is the sample code I tried.
    aspx:
    <form id="mainForm" method="post" runat="server"
     <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <telerik:RadGrid DataSourceID="SqlDataSource1" ID="RadGrid1" AllowFilteringByColumn="True" runat="server" Width="950px" AllowPaging="True"AllowSorting="True"AutoGenerateColumns="False">
      <MasterTableView PageSize="10"  TableLayout="Auto"  EnableHeaderContextMenu="true" EnableHeaderContextFilterMenu="true">
        <Columns>
           <telerik:GridNumericColumn DataField="OrderID" HeaderText="OrderID" SortExpression="OrderID" UniqueName="OrderID"></telerik:GridNumericColumn>
           <telerik:GridBoundColumn DataField="ShipName" HeaderText="ShipName" SortExpression="ShipName"UniqueName="ShipName"></telerik:GridBoundColumn>
           <telerik:GridDateTimeColumn DataField="OrderDate" HeaderText="OrderDate" SortExpression="OrderDate" UniqueName="OrderDate" PickerType="None" DataFormatString="{0:d}"></telerik:GridDateTimeColumn>
           <telerik:GridBoundColumn DataField="ShipCountry" HeaderText="ShipCountry" SortExpression="ShipCountry" UniqueName="ShipCountry"></telerik:GridBoundColumn>
       </Columns>
     </MasterTableView>
    <ClientSettings>
       <ClientEvents OnColumnHidden="onColumnHidden" />
           <Scrolling AllowScroll="true" UseStaticHeaders="true" />
        </ClientSettings>
    </telerik:RadGrid>
    <asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString3 %>"
            ProviderName="System.Data.SqlClient" SelectCommand="SELECT top 50 * FROM Orders" runat="server">
        </asp:SqlDataSource>
    </form>
    JS:
    <script type="text/javascript">
        function onColumnHidden(sender, args)
        {
            sender.get_masterTableView().get_element().style.tableLayout = "auto";
            sender.get_masterTableViewHeader().get_element().style.tableLayout = "auto";
            window.setTimeout(function () {
                sender.get_masterTableViewHeader().get_element().style.tableLayout = "fixed";
               sender.get_masterTableView().get_element().style.tableLayout = "fixed";
            }, 1)
       }
    </script>

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. JJ
    JJ avatar
    147 posts
    Member since:
    May 2010

    Posted 14 Jun 2012 Link to this post

    If I don't use UseStaticHeaders="true", I don't see the extra white space at the last column, everything is fine. but if use UseStaticHeaders="true",  the extra white space still hold there after hide the column, the rest of the column won't auto expand to the right of the grid to cover the hide column space while using IE, but firefox works.
  5. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 19 Jun 2012 Link to this post

    Hello,

    I suggest that you go through the forum thread below:
    http://www.telerik.com/community/forums/aspnet/grid/hiding-columns-with-a-static-header.aspx

    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.
  6. JJ
    JJ avatar
    147 posts
    Member since:
    May 2010

    Posted 19 Jun 2012 Link to this post

    I tried the sample code on the link, when I set EnableHeaderContextMenu="true" and try to hide column, the rest of the column won't be auto expand to cover the hidden column area - still get extra white space.  See attachment.

    Any one of below code will cause the problem. I need help to solve the problem.
    grid.ClientSettings.Resizing.AllowColumnResize = true;
      
    grid.ClientSettings.Scrolling.UseStaticHeaders = true;
  7. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 20 Jun 2012 Link to this post

    Hi JJ,

    As pointed in the forum thread referenced in my previous post  - hiding columns with static headers issue is due to a limitation of the current RadGrid control implementation. Unfortunately the only way to avoid this behaviour is to use non-static headers (set UseStaticHeaders="false"). Please excuse us for the inconvenience caused.

    All the best,
    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.
  8. JJ
    JJ avatar
    147 posts
    Member since:
    May 2010

    Posted 20 Jun 2012 Link to this post

    How about for grid.ClientSettings.Resizing.AllowColumnResize = true? It causes the sample issue as UseStaticHeaders=true.  Is there any work around for that?

    Thanks
  9. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 22 Jun 2012 Link to this post

    Hello JJ,

    When using resizing with scrolling and static headers only the GridTableView is resized - RadGrid's width remains fixed. Therefore the blank space after the last column is expected. The grid does not support automatic column width recalculations when the sum of the widths of all its columns is less than the sum of the grid width. Please turn off static headers or leave the control as is, with the ability to add a horizontal scrollbar or empty space on the right. Sorry about the inconvenience caused.

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017