i have a grid that is:
- grouped by Country
- then group by city
- then comes the detailed data.
the first group's row's value (country) contains a long concatenated string beside country name (ex:population, area, ..etc)
so the value doesn't fit in one row and is being cut.
1- i have resized the row in Grd_SO_InitializeGroupByRow(...) >> e.Row.height = 80; //it made the row's height bigger but the text is still cut.
2- i tried
UltraGridGroupByRow groupByRow = e.Row as UltraGridGroupByRow; groupByRow.Band.Override.RowSizing = RowSizing.Free; groupByRow.Band.Columns["country"].CellMultiLine = DefaultableBoolean.True;
and
foreach(UltraGridGroupByRow groupByRow in Grd_SO.Rows) groupByRow.Band.Override.WrapHeaderText = DefaultableBoolean.True;
3- i tried WrapHeaderText // but it wraps the header of the detailed data's column headers.
how can i please wrap the text that shows in a specific groupBy row as the (country) mentioned above.
Hi Ahmad,
I don't think the GroupByRow supports multi-line text, at least not through the regular object model. It might be possible to achieve some kind of wrapping using a CreationFilter, but it depends on what kind of wrapping you are talking about.
Does the text in the column for which you are grouping have line breaks in the actual text? Or are you just trying to wrap the text based on the available space?
The former case is probably very easy to implement by just modifying the text element that displays the text to honor the line breaks.
The latter case is trickier since it requires a limited width and I am pretty sure the GroupByRow sizes it's width based on the text, so there will never be a width limit - although I could be wrong about that.
Hi Mike,
how can i "modify the groupByRow that displays the text to honor the line breaks"?
Thanks
Hi,
I don't understand what you are asking. This seems to just be a repeat of your original question which I am trying to help you with. But you didn't answer my questions, so I'm not sure how to assist you further. Please answer my questions, and I will see if there is some way to achieve what you want.
Does the text in the column for which you are grouping have line breaks in the actual text?
Or are you just trying to wrap the text based on the available space?
There are a number of hurdles here. First, the element that's being used to draw the text in the GroupByRow is a DependentTextUIElement. Setting this to allow Multiline text is problematic because it means you would have to replace this element entirely and create your own provider. I did that, but it still didn't work because the Description of the GroupByRow does not contain any line breaks even when the text in the grid cell being grouped does. So they must get stripped out somewhere.
So that means you also have to set the Description inside of the InitializeGroupByRow to re-include the line breaks.
I have attached a small sample project here that demonstrates this technique. You can probably re-use the CreationFilter in my example just as it is. But you will likely want to change the InitializeGroupByRow event handler to build a better description string.
hi Mike,
Yes, i have line breaks in my text. that's why i asked about the meaning of that phrase because it serves my case.
my text is a concatenation of 4 texts: "country <line break> area + population + language"
so i want to have country on the first line, then area + population + language on the line below it, in the same header row.
sorry for inconvenience.
thanks