ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Automatically adjust width according to column context in the grid
Title:
B
I
{code}
?
Hi I need certain columns to have automatically adjusted width according to context in the grid. For example: a product name content is very long (200 letters and many words) then the column will take half of the browser window. If a product name is short (7 letters and one word) then width will be small portion of the browser window. Is it possible? thanks in advance.
Save Changes
Cancel
ross
asked at 08 May 2016
Answers
B
I
{code}
?
you could have many names some very small and other large, but the column width is one, and it can not depend on the value (unless you write some custom js that does that), what you can do is not set it at all, this will mean that this column will take all the remaining width, and set the width for all the other columns where you know the width, also you can set the Grid ColumnWidth , @Html.Grid(...).ColumnWidth(250) this will tell the grid how much width in px of a column with unassigned Width property needs to be reserved when calculating the grid content width
Save Changes
Cancel
Omu
answered at 09 May 2016
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK