Hello,
Is it possible to turn [columnHiding] on when using [showToolbar] and set a default that hides some columns on the grid? If so, please provide an example.
Thanks!
Hello Jason,
After investigating this further, I determined that if the toolbar is not enabled, enabling the columnhiding property will have no effect. However showToolbar and columnHiding could be set to the grid using variables, set in the ts file. And in the ngOnInit() if showToolbar is enabled, then to set columnHiding to true.
Regarding default hidden columns, this could be achieved by adding hidden property set to true, to any of the columns:
<igx-column [field]="'CompanyName'" [header]="'Company Name'" [hidden]="true">
A column could also be hidden in the ts file. For example a method could be bound to the onColumnInit event:
<igx-grid . . . (onColumnInit)="initializeColumn($event)">
and to hide column with index 0 the following way:
public initializeColumn(evt){
if(evt.index == 0){
evt.hidden = true;
}
I have prepared a sample, demonstrating the described behavior. Please test it on your side and let me know if you need additional information regarding this matter.
Regards,
Monika Kirkova,
Infragistics
Well I feel silly. That was very simple. Thanks for the help!
I am glad that you managed to resolve your issue.
Thank you for using Infragistics components.