We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

SfDataGrid column hide/unhide

Hi,
I need to hide/unhide columns dynamically in a SfDataGrid, depending on the user tap on a button. The GridColumn class does not seem to have the IsHidden property in Xamarin.iOS, so I change Width to zero for hiding and back to the original value for unhiding.

However when the cells are unhidden, they do not keep their properties, for example background colour. I call SetNeedsLayout() against the grid to make sure the LayoutSubviews() method of the cells is called, and the background colour property is actually set there, but the colour is white on the screen and my colour is ignored. Another property that is not consistent is HeaderBackgroundColour: I set it at grid level (GridStyle), but after unhide is reverted to white.

Does anyone know if this is a known problem or I am missing something?

Thanks
Paolo

4 Replies

DS Divakar Subramaniam Syncfusion Team September 27, 2016 09:58 AM UTC

Hi Paolo, 
 
Thanks for contacting Syncfusion Support. 
 
We have checked your query and we were not able to reproduce the reported issues in 14.3.0.32 version of assemblies. Could you please confirm us, in which version of assemblies the issues were reproduced? 
 
We have prepared a sample based on your queries and the background color is maintained properly after unhidden the column. You can download the sample from the below link for your reference. 
 
If you still facing the issues, please do revert us with modified sample reproducing the issues which will help us proceed further. 
 
Regards, 
Divakar. 



PM Paolo Mantovani September 27, 2016 12:46 PM UTC

Hi,
thank you for the reply. I need certain columns to be initially hidden, I reproduced the issue in your code in this way:
in MyViewController constructor

            sfgrid.AutoGeneratingColumn += (sender, e) => 
            {
                if (e.Column.MappingName == "Freight")
                {
                    e.Column.UserCellType = typeof(GridCellExt);
                    e.Column.Width = 0;
                }
            }
;

In my app the columns are not auto generated but it does not seem to make any difference
Thanks
Paolo



AN Ashok N Syncfusion Team September 28, 2016 05:57 PM UTC

Hi Paolo, 

Thanks for your reply. 

We are able to reproduce the “Unhidden column did not keep their properties” issue. We have logged a defect report on this and this fix will be available in our upcoming 2016 Vol 3-SP1 release, which will be rolling out on End of October, 2016. We will update you once release is rolled out.  

Regards, 
Ashok 



AN Ashok N Syncfusion Team November 3, 2016 04:03 AM UTC

Hi Paolo,  
 
We are glad to announce that our Essential Studio Volume 3 SP 1, 2016 (Version 14.3.0.52) is rolled out which includes the fix for the reported issue “Unhidden column did not keep their properties” and is available for download under the following link.  
 
                                               
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.  
 
Regards,  
Ashok  


Loader.
Live Chat Icon For mobile
Up arrow icon