Forums

Setting DataGrid columns visibility
Last Post 02 Sep 2017 10:00 PM by Filip Dušek. 2 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
A TUser is Offline
New Member
New Member
Posts:34


--
31 Aug 2017 06:52 PM
    As it was suggested to me once, I use partial class with a method that changes column visibility. E. g.:
        public partial class MyUI : UIRoot
        {
            public void CollapseColumns(int[] columns)
            {
                foreach (int i in columns)
                    dataGrid1.Columns[i].Visibility = Visibility.Collapsed;
            }
        }
    

    But column header doesn't collapse (while the rest of the column collapses as expected). I suspect it's a bug, because, when I set Visibility to Collapsed in XAML, everything works as expected and headers collapse.
    A TUser is Offline
    New Member
    New Member
    Posts:34


    --
    01 Sep 2017 01:09 AM
    It turns out that the problem is not just with headers: other cells don't collapse too if there is something inside them (e. g. a button).
    Filip DušekUser is Offline
    Advanced Member
    Advanced Member
    Posts:674


    --
    02 Sep 2017 10:00 PM
    thanks for report, i will check that out
    You are not authorized to post a reply.