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

Dynamic columns in grid

4 Answers 314 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Volker
Top achievements
Rank 1
Volker asked on 22 Nov 2013, 02:45 PM
Hi,

I just watched the keynote to the new release Q3/2013. While there are many cool features, I am a little underwhelmed by what was presented regarding adaptiveness of the grid.

What I expected: I thought there would be a feature that allows me to dynamically (depending on the screen size) add or remove columns shown in the grid. That's rather a usecase for me than soemone showing the grid on a mobile.

Are there solutions for this? I think there were announced at some point in time, not long ago...

Thanks,
Volker

Edit: Here is the link to the blog post I had in mind: 
http://www.kendoui.com/blogs/teamblog/posts/13-10-10/building-an-adaptive-grid-and-scheduler-for-kendo-ui.aspx

4 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 26 Nov 2013, 12:17 PM
Hi Volker,

Apologise if we mislead you - the pictures of the grid in the blog post are missing the horizontal scrollbar which can lead to the impression that the columns are hidden. Instead the columns are not hidden, but the user should scroll to them. Our point in the blog was that the columns would not be resized, instead the overflow will be handled by a horizontal scrollbar.

Also please note that you can implement custom solution in which to detect current device that is accessing the page and render different version of the grid (with less number of columns) if this is your current requirement. 

Kind Regards,
Vladimir Iliev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Volker
Top achievements
Rank 1
answered on 26 Nov 2013, 04:40 PM
Hi Valdimir,

Thanks for the reply. Could you point me in a direction how I could handle this with the mentioned custom solution?

Personally, I thinkg that this is somehow important. With users' screens ranging from 22" widescreen to 14" old format" screen, for me this is even more important than the mobile stuff that I will anyway handle in a separate app. So I am not really talking about mobile here, but for example about a tablet with only 1024 pixels width. And adding/removing columns seems better to me than adding a scrollbar.

Best regards,
Volker

0
Accepted
Vladimir Iliev
Telerik team
answered on 28 Nov 2013, 11:33 AM
Hi Volker,

Basically detecting the user agent as well as the current user resolution is not directly related to KendoUI but is a general programing task. More information on the topic is available on various resources over the internet.

For convenience I created small jsBin example which on page load detects current browser width and based on it renders between 2 and 5 columns:

You can adapt this demo for KendoUI for ASP.NET MVC executing custom code after the Grid initialization which hide given columns using for example "hideColumn" method. 

Kind Regards,
Vladimir Iliev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Volker
Top achievements
Rank 1
answered on 04 Dec 2013, 08:52 AM
Hi again,

And thanks a lot - I know that this is of course not related to Kendo, but I thought there might be a Kendo funtion supporting this, like "conditionalColumn" depending on screen size or something like that. But the way you described should be ok.

Kind Regards,
Volker
Tags
Grid
Asked by
Volker
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Volker
Top achievements
Rank 1
Share this question
or