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

extra line on radgrid header

7 Answers 212 Views
Grid
This is a migrated thread and some comments may be shown as answers.
JJ
Top achievements
Rank 1
JJ asked on 13 Jun 2012, 11:40 PM
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

7 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 14 Jun 2012, 06:02 AM
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.
0
JJ
Top achievements
Rank 1
answered on 14 Jun 2012, 01:25 PM
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.
0
Pavlina
Telerik team
answered on 19 Jun 2012, 03:44 PM
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.
0
JJ
Top achievements
Rank 1
answered on 19 Jun 2012, 05:05 PM
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;
0
Pavlina
Telerik team
answered on 20 Jun 2012, 02:34 PM
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.
0
JJ
Top achievements
Rank 1
answered on 20 Jun 2012, 03:09 PM
How about for grid.ClientSettings.Resizing.AllowColumnResize = true? It causes the sample issue as UseStaticHeaders=true.  Is there any work around for that?

Thanks
0
Pavlina
Telerik team
answered on 22 Jun 2012, 02:24 PM
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.
Tags
Grid
Asked by
JJ
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
JJ
Top achievements
Rank 1
Pavlina
Telerik team
Share this question
or