Hi,
I am adding dynamic column to ultragrid. I have set the Width and height as below.
bgCandE.DisplayLayout.Override.DefaultRowHeight = 50;
bgCandE.DisplayLayout.Override.DefaultColWidth = 200;
and enable word wrapping and truncation using the below code in the
ultragrid InitializeLayout event.
ugCol.CellMultiLine =
DefaultableBoolean.True;
ugCol.Band.Columns[ugCol.Key].CellMultiLine =
1) Word Wrapping and truncation is not happening for Column Header.How to achieve word wrapping and truncation in the dynamic column header.
2) For the above set column height and width ,it display three rows and truncation happens. If value in the cell is small whcih fits for the only one line,it always displays height of three rows but i want don't want to display the blank row in the cell.
If it has value for one row,then only one row has to be displayed which no blank row.If it has the value for two rows,then two rows has to be displayed which no blank row. if it has three or more rows,truncation should happen and display three rows only.
How to achieve this.
Thanks in advance
Regards
Vijay A
Hi Vijay,
a_vijay said: ugCol.CellMultiLine = DefaultableBoolean.True; ugCol.Band.Columns[ugCol.Key].CellMultiLine = DefaultableBoolean.True;
Are you aware that these two lines of code are exactly the same? You are setting the same property on the same column twice.
a_vijay said:1) Word Wrapping and truncation is not happening for Column Header.How to achieve word wrapping and truncation in the dynamic column header.
CellMultiLine only affects the cells. For the column header, you will want to do something like this:
e.Layout.Override.WrapHeaderText = DefaultableBoolean.True;
a_vijay said: 2) For the above set column height and width ,it display three rows and truncation happens. If value in the cell is small whcih fits for the only one line,it always displays height of three rows but i want don't want to display the blank row in the cell. If it has value for one row,then only one row has to be displayed which no blank row.If it has the value for two rows,then two rows has to be displayed which no blank row. if it has three or more rows,truncation should happen and display three rows only.
I'm not entirely sure I understand your question, but it sounds like you want the grid rows to automatically adjust their height based on the contents of the row. The grid row heights are synchronized by default so they all have to be the same height. To allow the heights to vary, you have to set the RowSizing property to one of the "Free" settings. In your case, you probably want this:
e.Layout.Override.RowSizing = RowSizing.AutoFree;
HI Mike Saltzman,
Thanks for the reply.
1) By doing the below line, word wrapping happens in the column header.
but i have to display maximum three line of data and how to increase the height of column header dynmically. It takes default column header height only.
2) e.Layout.Override.RowSizing = RowSizing.AutoFree does reduce the row height based on the cell content dynamically.
AutoFree property will resize the row based on the largest cell in the Row. Even though i do not have cell with larger content in the row,it display the row with height which is set in the InitializeLayout.