Hi Everyone
I have Ultragrid and i have column called text where there is some text and other columns like font-family,style,size,weight,color,backcolor,border and bordercolor. If i change some values in this it should get reflected in the text column according to the chosen values from all these.
I tried to do it in but i couldn get it i dont know where i have gone wrong.
Is there any way to do it.
Colud someone help me please
Thanks in advance
Ferdin
Hello Nitin,
Did you try the different overloads of this method?
If you use it this way:
e.Layout.Bands[0].PerformAutoResizeColumns(false, Infragistics.Win.UltraWinGrid.PerformAutoSizeType.VisibleRows, Infragistics.Win.UltraWinGrid.AutoResizeColumnWidthOptions.IncludeCells);.
It should NOT take into account the hidden cells and should autosize to width only by the cell's contents.
If this does not help, please attach a screenshot of the issue after using this code so I can take a look, something might come up on my mind.
Hi Boris,
I think I am trying to solve the problem with wrong approach.
The issue is, user wants to have a solid view of data. In other words the solution is to resize the columns width according to the cell data present in all the rows instead of changing the font size of cell (that anyway will not solve this issue), so that the width will be equal to the max. length of the data in any of the cell for that column.
For that I tried PerformAutoResizeColumns, but there we have other issues with this approach:
1. We have one column of type boolean, showing the cell as checkbox, hidden by default. On some action we unhide that column. But when I apply PerformAutoResize that column is still hidden.
2. After applying PerformAutoResize, the data in some of columns is chopped off.
Will appreciate if you can suggest anything on this?
Thanks,
Nitin Jain
Nitin,
You could use Bands[0].Columns[0].CellAppearance.FontData.SizeInPoints = 15; in case you want every cell to have the same font size.
Don't we have any other way to resize the font as this would be messy to set Style for each column and then set value with this info for each column.
This is in order for the column to take such tags as <font>. The values of the cells are different for each cell and should be set separately, in the 'InitializeRow' event for example.