Home Forums WinForms controls Xceed Grid for WinForms Fixed-aligned text on group SummaryRow

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

    Hi,

    I have created a number of groups that contain SummaryRows to summarize row data. Each have a TextFormat that displays text that works like a header. What I want to do is to set it fixed so that if I scroll horizontally, the text will always be visible – like it works with fixed columns. Is this possible? I have tried to apply the property “ShowFixedColumnSplitter” to the SummaryRow, but it does not appear to work as I aquire.

    Can you please help me with this?
    Thank you in advance!

    Regards,
    Annette Skår

    Imported from legacy forums. Posted by annetteS (had 1188 views)

    User (Old forums)
    Member
    Post count: 23064

    The only solution I see is to fix one column, and set the corresponding cell in the SummaryRow with the text you want fixed.

    Imported from legacy forums. Posted by André (had 403 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi André,

    Thank you for the reply! I had a similar thought, but I am uncertain in which property to set the text for the SummaryCell? I am unable to set the SummaryCell.Value (error message: “the value is automatically calculated and is not modifiable”), even though I have StatFunction.None on this particualar cell… Property Title is read-only (even though the corresponding column is not read-only..). Do you have any tips?

    Thanks in advance!

    Regards,
    Annette Skår

    Imported from legacy forums. Posted by annetteS (had 338 views)

    User (Old forums)
    Member
    Post count: 23064

    Taken from another thread :

    “the TitlePosition property sets where the “THIS IS MY ” title is displayed. The TitleFormat is always displayed in the SummaryCell next to the one running the statistical function, for the function uses the whole cell to display its result. If you use the first SummaryCell, you need to set the TitlePosition to right, else the title will not be displayed. If you have set the TextFormat on the SummaryRow, then you cannot use the first or the second SummaryCell (or any cell that the SummaryRow writes to for that matter), for the statistical function result will be displayed over the TextFormat of the SummaryRow. In the second cell, if you set the the TitlePosition to right, then it can work if the SummaryRow.TextFormat is limited to the first cell.”
    http://xceed.com/CS/forums/thread/1910.aspx

    So set the Title of the SummaryCell next to the cell where you want to show the text, then set the TitlePosition to the left, and it should do the trick.

     

    Imported from legacy forums. Posted by André (had 443 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi,

    I cannot quite understand how I should do this. I have two textcolumns, then one column for each day of the month – these have a statistical function in the corresponding SummaryCell.

    Example:
    Counterpart | Contract | Day1 | Day2 | Day3 | etc…
    Shell             No1  

      

    Imported from legacy forums. Posted by annetteS (had 263 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi André,

    (Please ignore my previous post)

    This is my code:

        protected void AddGroupSummaryRow(Group group, string summaryRowTextFormat) {

            SummaryRow summaryRow = new SummaryRow();
            summaryRow.TextFormat = summaryRowTextFormat; // text: “Balance”
            summaryRow.ShowFixedColumnSplitter = ShowFixedColumnSplitter.WhenFixedColumnsExist;
            group.FooterRows.Add(summaryRow);

            // we only want to summarize numeric columns
            foreach (SummaryCell summaryCell in summaryRow.Cells) {
                if (summaryCell.ParentColumn.DataType == typeof(int)) {
                    summaryCell.StatFunction = Xceed.Grid.StatFunction.Sum;
                    //summaryCell.TitleFormat = summaryRowTextFormat;
                    //summaryCell.TitlePosition = TitlePosition.PreferablyRight;
                }
                else {
                    summaryCell.StatFunction = Xceed.Grid.StatFunction.None;
                }
            }
        }

    In my grid I have three columns that contain text (“Counterpart”, “Conctract” and “Deliverypoint”. These columns are fixed (to be able to see them always as I scroll horizontally). In addition I have columns for each day of the month (on day in each column). These columns have a statistical function in their corresponding SummaryCell of the SummaryRow on a group. To display a text on the SummaryRow of the group, I have originally used SummaryRow.TextFormat. This works well for displaying the text, but when I scroll to the right, the text disappears out of view. So I was looking for a way to fix the text similar to the way we can fix a column. If I set the SummaryCell.TitleFormat (as you suggested) instead of the SummaryRow.TextFormat, the text displays correctly, but still it disappears out of view when I scroll.

    I tried to set the SummaryCell.TitleFormt explicitly for the columns that only contain text (since these columns are fixed), but the text is not displayed at all.

    What I am doing wrong?
    Thanks in advance!

    Regards,
    Annette Skår

    Imported from legacy forums. Posted by annetteS (had 543 views)

    User (Old forums)
    Member
    Post count: 23064

    Well, it seems I made an error.  I thought the SummaryCell would be fixed for the corresponding column, but this is not the case.  So what you want is not possible.  This would be a feature request.

    Imported from legacy forums. Posted by André (had 491 views)

    User (Old forums)
    Member
    Post count: 23064

    Ok, no worries. I look forward to this functionality in future releases! Thanks for your help.

     Beste regards,
    Annette

    Imported from legacy forums. Posted by annetteS (had 1228 views)

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