Lock Autogenerated Column In Kendo Grid

4 posts, 1 answers
  1. Stuart
    Stuart avatar
    7 posts
    Member since:
    Jan 2015

    Posted 14 Sep 2015 Link to this post

    I have a DataSet that I'm generating on the fly.

    I'm doing this by collecting all of my data and then building a DataTable and then using the DataTable as a DataSource for my Kendo Grid.

    The Grid is set up to use AutoGenerated columns, like this ...

      .Columns(c =>
      .Resizable(a =>

    I want to freeze the first column in this Grid (I will always know what this column is).

    I haven't found a way of manipulating the Columns at all when using AutoGenerated columns and have had to resort to a number of jQuery/CSS 'fudges' to get the Grid looking and behaving the way that I want it to.

    However, I'm at a loss as to how I might be able to freeze a column when the Grid uses AutoGenerated columns.

    Is is actually possible?

    If it is, would you care to give me a hint as to how I might go about it?

  2. Stuart
    Stuart avatar
    7 posts
    Member since:
    Jan 2015

    Posted 14 Sep 2015 in reply to Stuart Link to this post



    More digging turned up this Code Library post so I have modelled my solution on that.

    Now I'm getting some proper weirdness when I try locking the column. Have a look at this Jing video and you'll see my point.

    In short what happens is, if the grid is rendered with no locked columns, all works as expected. With the first column locked, the heading for that column shows but all the rows (for that column) are blank and they are blank because they have all been shifted right one column.

  3. Answer
    Pavlina avatar
    6187 posts

    Posted 16 Sep 2015 Link to this post


    When Grid scrolling is enabled, the Grid renders two tables. If frozen columns are used, there are four tables. If the Grid is not configured properly, or if there are some conflicting CSS styles on the page, the layout might break. 

    I tested the code library you pointed with first columns locked and only the frozen column appears in the grid. The other columns do not occur because they have no widths. After I applied widths to the missing columns the problem disappear. Could you please confirm that missing column widths is not the problem in your case as well.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  4. Stuart
    Stuart avatar
    7 posts
    Member since:
    Jan 2015

    Posted 16 Sep 2015 in reply to Pavlina Link to this post



     Thank you.

Back to Top