Home Forums WinForms controls Xceed Grid for WinForms groupManagerRow Custom Text based on summary row

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #15622 |

    Hi,

    I want to change the default header text for a GroupBy. So instead of having say Task : Meeting – 3 item(s) I would like to change the header text to the sum of values for the cells in the GroupBy for example Task : Meeting – Total Effort : 30

    I have looked into using the SummaryRow but if I collapse the group then the summaryrow is not visable.

    Thanks

    Andrew

    Imported from legacy forums. Posted by Andrew (had 1922 views)

    Xceed Support
    Member
    Post count: 5658

    You can directly subscribe to the GroupAdded event and override the TitleFormat to change to custom text.

    <a href=”http://doc.xceedsoft.com/products/Xceedgrid/Xceed.Grid~Xceed.Grid.GroupManagerRow~TitleFormat.html”>GroupManagerRow’s Title Format</a>

    Here is a little snippet that can get you started:

    e.g.,

    <code>
    private void Form1_Load( object sender, EventArgs e )
    {
    //…
    gridControl1.GroupAdded += new Xceed.Grid.GroupAddedEventHandler( gridControl1_GroupAdded );
    }

    void gridControl1_GroupAdded( object sender, Xceed.Grid.GroupAddedEventArgs e )
    {
    foreach(GroupManagerRow row in e.Group.HeaderRows)
    {
    row.TitleFormat = “Task : Meeting – Total Effort : %SUM:EffortColumn%”;
    }
    }
    </code>

    Imported from legacy forums. Posted by CharlesB (had 3062 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.