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
a_vijay said: But i have to display maximum three line of data
But i have to display maximum three line of data
There's no way to set a Maximum height on the column headers. There's a ColHeaderLines property you could use to set the height of the headers to 3. But then I think you would need to turn off WordWrapping and use line breaks in the header text to get it to wrap.
a_vijay said:how to increase the height of column header dynmically. It takes default column header height only.
I don't understand the question.
a_vijay said: 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.
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.
Is this a question, or are you just saying that you have achieved what you wanted.
HI Mike Saltzman,
Thanks for the reply.
1) By doing the below line, word wrapping happens in the column header.
e.Layout.Override.WrapHeaderText = DefaultableBoolean.True;
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.
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:
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;