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

Hiding column bug when using Column groups

8 Answers 173 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lionel Najman
Top achievements
Rank 1
Lionel Najman asked on 11 Jun 2013, 06:33 PM
Hi I'm using Telerik ASP .Net Ajax 2013.1 417 (latest stable version)

I wand to trigger hide/show column with HeaderContextMenu and ColumnGroups

Under some circonstances layout is messed up, changes are not applied correctly to the columns groups.

Here is my sample:
- When deselecting Appt column (column 3): the third column group (Action) is wrongly hidden (display:none is added)
- When deselecting Nom 2 column (column 7) : the seond column group is not changed, resulting in a messed up display (its colspan shoud be lowered and it's not)

Can you help me?
<telerik:RadGrid   ID="RadGrid1"  OnItemCreated="RadGrid1_ItemCreated"  PageSize="2" AllowPaging="true" runat="server"  Skin="Default" Culture="fr-FR"   OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged"  DataSourceID="DataSource1" >
    <MasterTableView  runat="server"  AutoGenerateColumns="False"   CommandItemDisplay="None" EnableHeaderContextMenu="true">
     
     <CommandItemSettings  ShowExportToCsvButton="true" />
            <ColumnGroups>
            <telerik:GridColumnGroup  Name="Mandat" HeaderText="Mandat"  HeaderStyle-CssClass="GroupingHeaderTitle" />
          
                    <telerik:GridColumnGroup Name="Candidat" HeaderText="Candidat"   HeaderStyle-CssClass="GroupingHeaderTitle"/>
                    <telerik:GridColumnGroup Name="Action" HeaderText="Action" HeaderStyle-CssClass="GroupingHeaderTitle" />
                     
            </ColumnGroups>
            <Columns>
               <telerik:GridTemplateColumn Groupable="false" HeaderText="N°" ColumnGroupName="Mandat">
                 
                    <ItemTemplate><asp:Label ID="LblNumeroMandant" Text='<%# Eval("TmpUnite_NoMdt") %>' runat="server" /></ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn Groupable="false" HeaderText="Nom" ColumnGroupName="Mandat">
                    <ItemTemplate><asp:Label ID="LblNomMandant" Text='<%#Eval("TmpUnite_LbMnd") %>' runat="server" /></ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn Groupable="false" HeaderText="Appt" ColumnGroupName="Mandat">
                    <ItemTemplate><asp:Label ID="LblAppt" Text='<%# Eval("TmpUnite_NoApp") %>' runat="server" /></ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn Groupable="false" HeaderText="Nature" ColumnGroupName="Mandat">
                    <ItemTemplate><asp:Label ID="LblNature" Text='<%#Eval("TmpUnite_LbApp") %>' runat="server" /></ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn Groupable="false" HeaderText="Vacant" ColumnGroupName="Mandat">
                    <ItemTemplate><asp:Label ID="LblVacant" Text='<%#Eval("TmpUnite_DtVac") %>' runat="server" /></ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn Groupable="false" HeaderText="N°" ColumnGroupName="Candidat">
                    <ItemTemplate><asp:Label ID="Lbl" Text='<%# Eval("TmpCandloc_NoMdt") %>' runat="server" /></ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn Groupable="false" HeaderText="Nom 2" ColumnGroupName="Candidat">
                    <ItemTemplate><asp:Label ID="LblNomCandidat" Text='<%# Eval("TmpCandloc_LbClo") %>' runat="server" /></ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn Groupable="false" HeaderText="Annulation" ColumnGroupName="Candidat">
                    <ItemTemplate><asp:Label ID="LblAnnulation" Text="" runat="server" /></ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn Groupable="false" HeaderText="Action" HeaderStyle-HorizontalAlign="Center"  ColumnGroupName="Action">
                    <ItemTemplate>
                        <center>
                        <asp:ImageButton ID="IBConsultation" SkinID="Consultation" runat="server" />  
                        <asp:ImageButton ID="IBModification" SkinID="Modification" runat="server" />  
                        <asp:ImageButton ID="IBSuppression" SkinID="Suppression" runat="server" />  
                        <asp:ImageButton ID="IBValidation" SkinID="Validation" runat="server" />
                        </center>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                 
            </Columns>
             
            <PagerStyle AlwaysVisible="true" Mode="NextPrevNumericAndAdvanced"  PageSizes="10,30,60" />
        </MasterTableView>
        <ClientSettings AllowColumnsReorder="True"  EnablePostBackOnRowClick="true"  EnableRowHoverStyle="true">
            <Resizing AllowColumnResize="true"  ClipCellContentOnResize="false" EnableRealTimeResize="true"  />
            <Selecting AllowRowSelect="true"/>
        </ClientSettings>
    </telerik:RadGrid>
(maybe as a correction in the future Q2 2013)

8 Answers, 1 is accepted

Sort by
0
Lionel Najman
Top achievements
Rank 1
answered on 12 Jun 2013, 09:56 PM
Hi,

I've tried latest Q2 2013: the behaviour is worse:now when columns groups are enabled, hiding a column only hide data rows, column group colspan is not affected and the hidden column header is not hidden anymore.

Thanks for your help
0
Angel Petrov
Telerik team
answered on 14 Jun 2013, 03:48 PM
Hello Lionel,

This is a known issue to us and is already logged into our system. Our developers are currently researching the matter and will provided a fix as soon as possible. For now you can workaround the problem by enabling the static headers functionality of the grid. In attachments you can find a sample website which uses the code provided and integrates this approach.

Please accept our apologies for the inconvenience this may have caused you.

Regards,
Angel Petrov
Telerik
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 the blog feed now.
0
Chris
Top achievements
Rank 1
answered on 30 Jul 2013, 09:25 PM
I'm currently experiencing this issue as well with version 2013.2.611.35

Is there any known workaround? I've noticed that the column group headers seem to lose their Name attribute, which is probably the root of the problem.

Is there any way I could perhaps insert a user defined attribute into the column group so I can at least reliably access the header object? If I can at least grab that, I can redefine the colspan appropriately.
0
Maria Ilieva
Telerik team
answered on 02 Aug 2013, 10:37 AM
Hello Chris,

As my colleague Angle previously mentioned possible workaround is to enable the static headers for the RadGrid control. Give this a try and let me know if it help.

Regards,
Maria Ilieva
Telerik
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 the blog feed now.
0
Curtis
Top achievements
Rank 1
answered on 02 Sep 2013, 06:04 AM
We are also experiencing this issue and enabling static headers did not fix the issue for us nor is that a workable solution for our end-users if it did work.

When is this expected to be fixed?

Thanks,
Curtis
0
Maria Ilieva
Telerik team
answered on 04 Sep 2013, 11:37 AM
Hello Curtis,

In case enabling the Static Headers does not fix the issue I would suppose that the problem could be related with your scenario and is not  exactly the known issue discussed in this thread. Therefore it will be bets if you cold open a separate support ticket and elaborate a bit more on your scenario. Thus we will be able to further investigate the problem and do our bets to provide proper solution.

Regards,
Maria Ilieva
Telerik
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 the blog feed now.
0
Matthew Botting
Top achievements
Rank 1
answered on 17 Jun 2014, 01:56 AM
I have a similar issue where in code I am dynamically setting columns to be visible = false
This completely messes with the layout of the columngroups,
I have tried setting display = false instead but it does not work.

The static headers does not fix this issue.

What I really need to be able to do is to modify the colspan of the ColumnGroup but it is read only.

Any ideas?
0
Maria Ilieva
Telerik team
answered on 19 Jun 2014, 12:17 PM
Hi Matthew,

It appears that you are facing specific issue that might be caused by various circumstances.
Therefore in order to be able to provides the best solution for you specific case I would suggest you to open a separate support ticket and provide detailed description for your scenario and the exact issue you are facing.

Thus we will be able to insect it locally and advise you further.

Regards,
Maria Ilieva
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
David
Top achievements
Rank 1
Iron
Iron
Veteran
commented on 06 May 2021, 02:06 PM

This is an old thread, but i still have same issue. Was it ever fixed?
Attila Antal
Telerik team
commented on 11 May 2021, 10:40 AM

Hi David.

Showing and Hiding columns on the client-side while using MultiColumn Headers or FrozenColumns is a limitation of the Grid. Check out the MultiColumn headers section on the Known Limitations page.

MultiColumn Headers

The features below are not supported with multicolumn headers:

- Frozen Columns

- Show/Hide on the client

 

While the limitation still exists, we have created an example showing how to work around this. If you are only using ColumnGroups (MultiColumn Headers), check out the following Code Library example shared by Eyup: Show or Hide Multi-Column RadGrid Headers on Client-Side.

On a side note, this is a custom implementation intended to be a workaround for one specific scenario and may not work in other scenarios. 

David
Top achievements
Rank 1
Iron
Iron
Veteran
commented on 11 May 2021, 11:22 AM

:(. Thank you Atilla for confirming though
Tags
Grid
Asked by
Lionel Najman
Top achievements
Rank 1
Answers by
Lionel Najman
Top achievements
Rank 1
Angel Petrov
Telerik team
Chris
Top achievements
Rank 1
Maria Ilieva
Telerik team
Curtis
Top achievements
Rank 1
Matthew Botting
Top achievements
Rank 1
Share this question
or