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

Scaling of Grid Cells in response to font resizing

1 Answer 174 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 25 Jul 2012, 04:48 PM
Hi,
I have been given a task to implement font resizing in the grid and scale the grid correctly as font resizes. I've played with this for a while but could not get the grid to do this for me, so I ended up implementing a temporary hack to get around (only until I figure out a better way to do this).  Basically what I am trying to do is provide a slider for user to adjust a font of the data in the grid. As user changes the font size, the data in the grid is adjusted. What I am noticing (default behavior) is that if I increase the font size, the text is increased and grid scales the cells correctly (expanding them), but if I decrease the font size, the text is decreased but the cells stay as they were. I am attaching an example that works as follows: when you run it, you should see a grid with some data. Move mouse over the area with 5 dots below the grid and the options area will pop up. The options area has only a single option - font size. Moving that slider to increase the font and then to decrease it will demonstrate the problem (I guess it may not be a problem for others but it is for me).  You can use the toggle button at the top (Display Fixed) to demonstrate how I would like the grid to behave - just press the button and then use the same font size option to increase and then decrease font. What I am looking for a way to resize grid columns to fit the text. The solution I implemented is not very efficient or reusable and is tied to the bound data (I figure out the size of each column differently based on the bound data). 

Thanks for the help

PS. Apparently I cannot attach zip files, so here is a link to the project (zipped up) that demonstrates the problem - gridresizeproblem.zip

1 Answer, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 26 Jul 2012, 08:48 AM
Hi,

 I've attached modified version of your project to illustrate you how to achieve your goal in this case. 

All the best,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Eric
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or