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

Grid Column Resizing when all columns have width set.

4 Answers 183 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 08 Apr 2013, 06:27 PM
I have set all the columns widths in a grid, when I resize one of the columns it seems to resize  the adjacent columns as well. 

When I don't set the column width on the last column it works as expected.
Here is a jsfilddle that has the behavior.
http://jsfiddle.net/mmowery/xpZHN/22/

I have tried to things like changing the scrollable, etc.

Hopefully, I am just missing something obvious.

Thanks in advance,
Michael

4 Answers, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 10 Apr 2013, 11:14 AM
Hello Michael,

The current column configuration is invalid, because the sum of all column widths is smaller than the Grid width. This makes the browser ignore the set widths and expand all columns. However, this breaks the resizing mechanism.

Pixel widths set to all columns should be used only if you want a horizontal scrollbar in the Grid. In your case, please leave at least one column with no width. If you need a resizable Grid in a variable width layout, you can set a min-width style for the component or the <table>.

Greetings,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Michael
Top achievements
Rank 1
answered on 10 Apr 2013, 03:18 PM
Dimo,
  Thanks for the reply.  That makes sense and is what I ended up doing.
Thanks,
Michael
0
Ray
Top achievements
Rank 1
answered on 18 Dec 2018, 12:05 PM
When I make a list page, I want to make it possible for the user to drag the column with the total number and save the location of the column, which is now in effect immediately, and next time I come in, the order of the column is still valid. The above is the order I changed.

The final record saved in the database is the one shown above.

Once on this page again, I get the data, as shown in the figure above.

See your example, it is written in this way, but it will never achieve the effect I want!!!

[Why do you just use ID to record its order instead of columne name here? There are many problems with id, for example, I have to drag multiple columns at the same time. Does the order of columns in the back affect the order in the front? It would be better to use column name + order index here.

This is my final effect, but not my order!!!

How can I achieve this effect?
0
Konstantin Dikov
Telerik team
answered on 20 Dec 2018, 06:51 AM
Hi Ray,

Could you please share the example that you are mentioning, where we are suggesting the approach in question? Note that if you need to persist the columns order and restore it on the next page load, you should use the "getOptions/setOptions" methods as shown in the following online demo:
If the requirement is to store the state on each column reorder, you could handle the "columnReorder" event of the Grid and within "setTimeout" function, retrieve the new options:
Hope this helps.


Regards,
Konstantin Dikov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Michael
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Michael
Top achievements
Rank 1
Ray
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Share this question
or