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
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