Hiding columns with a size of 0 leads to weird display

5 posts, 0 answers
  1. Amand
    Amand avatar
    23 posts
    Member since:
    Aug 2012

    Posted 23 Dec 2016 Link to this post

    Hello,

    I am trying to implement a hide/show option on column. For now, I implemented a contextual menu option to do it and as a workaround I set column size to 0 to hide it but it leads to weird display (cf attached image (with 10 hidden columns)). Do you know a better workaround to avoid this display ?

     

    Regards,

    Amand

  2. Dimitar
    Admin
    Dimitar avatar
    1871 posts

    Posted 23 Dec 2016 Link to this post

    Hello Amand,

    Hiding columns is not supported in RadVirtualGrid. To change the number of the displayed columns you just need to set the ColumnCount property. This way you would not need to load the data for the unnecessary columns as well. I have attached a small example that shows how you can achieve this. 

    I hope this information is useful. Let me know if you need further assistance.

    Regards,
    Dimitar
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Amand
    Amand avatar
    23 posts
    Member since:
    Aug 2012

    Posted 23 Dec 2016 Link to this post

    Hello,

    Thank you for your answer, I did the same for my grid but I still have problem with custom columns which are not placed at the right place even if I unregister and register with right index. Do you know how to do ?

     

    Regards,

    Amand

  4. Dimitar
    Admin
    Dimitar avatar
    1871 posts

    Posted 26 Dec 2016 Link to this post

    Hello Amand,

    Thank you for writing back.

    I can confirm that once added the custom column cannot be removed from the grid. I have logged the issue in our Feedback Portal. I have added a vote for it on your behalf as well. You can track its progress, subscribe for status changes and add your comment to it here. I have also updated your Telerik Points.

    Unfortunately due to the nature of the issue I cannot provide you with a workaround for it.

    Should you have any other questions do not hesitate to ask.

    Regards,
    Dimitar
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  5. Hristo
    Admin
    Hristo avatar
    1028 posts

    Posted 28 Dec 2016 Link to this post

    Hello Amand,

    I would like to follow back with some additional information about the discussed scenario.

    It appears that the issue is related to the UnregisterCustomColumn method. It can be worked around by manually accessing the CustomColumns collection. In order to immediately reflect the changes in the grid, you would also need to trigger an updated of the virtualized rows container: 
    this.radVirtualGrid1.MasterViewInfo.CustomColumns.RemoveAt(0);
    this.visibleColumns.Remove(e.Item.Text);
    foreach (VirtualGridRowElement rowElement in
        this.radVirtualGrid1.VirtualGridElement.TableElement.GetDescendants(delegate(RadElement x) { return x is VirtualGridRowElement; }, TreeTraversalMode.BreadthFirst))
    {
        rowElement.CellContainer.Children.Clear();
    }

    I am also sending you attached a project implementing the suggested approach.

    I hope this helps. Please let me know if you need further assistance.

    Regards,
    Hristo
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top