Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
245
Multi-Line GroupByRow Description
posted

I would like to modify the GroupByRow description to take up more than one line when printing.

Here is what I have tried:

 private void uGridReport_InitializeGroupByRow(object sender, InitializeGroupByRowEventArgs e)        

{            

     if (e.Row.Band.Layout.IsPrintLayout)            

          {                

               if (e.Row.ParentRow != null)                    

                    if (e.Row.Index != 0)                    

                    {                        

                           e.Row.StartsNewPrintedPage = true;                        

                           e.Row.Description = e.Row.ParentRow.Description + "\r\n" + e.Row.Description;                    

                     }

             }      

   }

Any ideas?

Parents
No Data
Reply
  • 469350
    Offline posted

    The GroupByRow does not support multiline text. You should Submit a Feature Request and perhaps this functionality can be added in a future release.

    The only way I can think of that you might be able to get it to work is if you increase the height of the row (by setting the Height property on the row) and then use a DrawFilter to draw the text yourself.

    this.ultraGrid1.DrawFilter = new MyDrawFilter();

    public class MyDrawFilter : IUIElementDrawFilter
        {
            bool IUIElementDrawFilter.DrawElement(DrawPhase drawPhase, ref UIElementDrawParams drawParams)
            {
                DependentTextUIElement dependentTextUIElement = drawParams.Element as DependentTextUIElement;
                if (null != dependentTextUIElement)
                {
                    drawParams.DrawString(dependentTextUIElement.RectInsideBorders, dependentTextUIElement.Text, true, true);
                    return true;
                }

                return false;
            }

            DrawPhase IUIElementDrawFilter.GetPhasesToFilter(ref UIElementDrawParams drawParams)
            {
                if (drawParams.Element is DependentTextUIElement &&
                    drawParams.Element.Parent is GroupByRowDescriptionUIElement)
                {
                    return DrawPhase.BeforeDrawForeground;
                }

                return DrawPhase.None;
            }
        }

Children