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

Hiding Columns

I''m currently using grid version 2.1.0.61. Is there a faster way to hide multiple columns in the grid besides hiding them one at a time in a loop? Thanks.

8 Replies

AD Administrator Syncfusion Team October 14, 2004 02:12 PM

You can use this.gridDataBoundGrid1.Model.Cols.Hidden.SetRange.


AA Anthony Avella October 19, 2004 01:40 PM

The problem for me with your solution is that the columns I''d like to hide are not sequential. Is there any way I can directly link individual columns from the grid''s datatable to the grid and let them be visible and force the rest not to be visible? If possible would changes to those columns in the grid still update the underlying datatable? Thanks, Anthony


AA Anthony Avella October 19, 2004 01:40 PM

The problem for me with your solution is that the columns I''d like to hide are not sequential. Is there any way I can directly link individual columns from the grid''s datatable to the grid and let them be visible and force the rest not to be visible? If possible would changes to those columns in the grid still update the underlying datatable? Thanks, Anthony


AD Administrator Syncfusion Team October 19, 2004 02:00 PM

Another way to hide miscellaneous columns is to handle grid.Model.QueryColWidth. In the handler, set e.Size = 0 when e.Index points to a column you want hidden. You would also need to set e.Handled = true.


AA Anthony Avella October 21, 2004 10:14 AM

Instead of hooking up a datatable to the grid as a datasource, is there any way to hook up indiviual columns from the datatable to the grid as the datasource?


AD Administrator Syncfusion Team October 21, 2004 10:51 AM

If you use a virtual GridControl, you can do this. Handle QueryCellInfo and provide the data on demand by setting e.Style.CellValue based on the values of e.ColIndex and e.RowIndex. You would be free to get the data from any place, including certain columns in a datatable, or columns from other datatables, or whereever.


AA Anthony Avella October 21, 2004 01:44 PM

Can we make a grouping grid a virtual grid? It''s my impression that one must choose a grid type, virtual, grouping, datagrid, etc... If this is possible, please provide a sample of how to do this. Secondly, if I can have a virtual grouping grid, what is the performance difference for loading the grid vs. hooking up a datatable to the grid as it''s datasource? How is my grouping functionality affected? Thirdly, will the grid still be connected to the source of the data to allow updates in the grid to be reflected in the datatable we store the data in? Thanks


AD Administrator Syncfusion Team October 21, 2004 02:38 PM

You cannot have a true virtual groupinggrid. You can handle QueryCellStyleInfo in a grouping grid to dynamically provide data, but you cannot dynamically provide row counts and column counts as the grouping engine must have access to all the data to be able to group/filter things.

Loader.
Live Chat Icon For mobile
Up arrow icon