Reputation: 1362
My example illustrates my problem (with comments): http://dojo.telerik.com/eyIHi
Problem explained here again:
Here is my code which is executed when the grid is built:
dataBound: function(e){
e.sender.showColumn('ContactName');
},
I did not find a function to redistribute them like the grid does in the beginning (API here: http://docs.telerik.com/kendo-ui/api/javascript/ui/grid)
Upvotes: 1
Views: 1252
Reputation: 1362
Auto fitting all columns after the change, then removing the set width from the grid reimposes their ability to strech relatively!
for(i=0;i<=self.sender.columns.length;i++){
self.sender.autoFitColumn(i);
}
self.sender.element.find('table[role="grid"]').removeAttr('style');
Upvotes: 1
Reputation: 3169
If you want all your columns to distribute evenly across the grid width, don't specify a width for any of them. It does not sound like you want the columns to be 50px at all.
http://dojo.telerik.com/@Stephen/aRUGi
Also, the Kendo documentation explains why your 50px columns stretch to fill the entire grid despite explicitly setting them the 50px: http://docs.telerik.com/kendo-ui/controls/data-management/grid/appearance#column-widths. The paragraphs starting at "When all columns have pixel widths,..." is particularly relevent.
Upvotes: 0