Dynamic columns in grid

5 posts, 1 answers
  1. Volker
    Volker avatar
    22 posts
    Member since:
    Jul 2013

    Posted 22 Nov 2013 Link to this post

    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
  2. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 26 Nov 2013 Link to this post

    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!
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Volker
    Volker avatar
    22 posts
    Member since:
    Jul 2013

    Posted 26 Nov 2013 Link to this post

    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

  5. Answer
    Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 28 Nov 2013 Link to this post

    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!
  6. Volker
    Volker avatar
    22 posts
    Member since:
    Jul 2013

    Posted 04 Dec 2013 Link to this post

    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
Back to Top
UI for ASP.NET MVC is VS 2017 Ready