This is a migrated thread and some comments may be shown as answers.

Hide column at runtime

4 Answers 750 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Madzie
Top achievements
Rank 1
Madzie asked on 25 Feb 2014, 02:20 AM
Hi,
Is there a way out to hide column at definition time itself ? Say, a variable contains true/false value that determines if a column is to be shown/hidden.
Any template or anything ? I use the the client side scripting.​
I know this one,
but it is on user action, i would like to hide/show columns at time of definition itself.

4 Answers, 1 is accepted

Sort by
0
Madzie
Top achievements
Rank 1
answered on 25 Feb 2014, 02:21 AM
0
Dimiter Madjarov
Telerik team
answered on 25 Feb 2014, 06:41 AM
Hi Madhuri,


To achieve this you could use the dataBound event of the Grid and hide/show columns via the API in the event handler.
E.g.
function onDataBound(e) {
    this.hideColumn(0);
}


Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Madzie
Top achievements
Rank 1
answered on 26 Feb 2014, 07:31 AM
But this dataBound event is called n times, n = number of rows !
Any other effective way out ?
0
Dimiter Madjarov
Telerik team
answered on 26 Feb 2014, 10:48 AM
Hi Madhuri,


The dataBound event is fired once, when the widget is bound to the data from the dataSource. Could you please try the approach on your side and let me know if it covers the current requirements?

Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Madzie
Top achievements
Rank 1
Answers by
Madzie
Top achievements
Rank 1
Dimiter Madjarov
Telerik team
Share this question
or