Add the total of row under the row number

6 posts, 0 answers
  1. Thomas LEBRUN
    Thomas LEBRUN avatar
    66 posts
    Member since:
    Sep 2009

    Posted 04 Nov 2009 Link to this post

    Hi,

    I'm trying to add the total number of row in the grid but i want to display it under the row number (see pic).
    I've use the code below:

    public

     

    void SetTextBoxTotalFooter()

     

    {

     

    // Set the binding on the footer containing the number of row

     

     

    var indicatorPresenter = this.FooterRow.ChildrenOfType<IndicatorPresenter>().First();

     

     

    var grid = indicatorPresenter.ChildrenOfType<Grid>().First();

     

     

    var tb = new TextBlock

     

    {

    HorizontalAlignment =

    HorizontalAlignment.Center,

     

    VerticalAlignment =

    VerticalAlignment.Center,

     

    Text =

    this._Xwg.Items.Count.ToString()

     

    };

     

    if (grid.Children.Count == 1)

     

    {

    grid.Children.Insert(1, tb);

    }

     

    else

     

    {

    grid.Children[1] = tb;

    }

    }



    It works fine except that if number is important (more that 999), the content of the TextBlock is not displayed correctly (some number are truncated).

    Any ideas on how to solve that ?


    Thanks !
  2. Thomas LEBRUN
    Thomas LEBRUN avatar
    66 posts
    Member since:
    Sep 2009

    Posted 04 Nov 2009 Link to this post

    Nobody got an idea ?


    Thanks !
  3. DevCraft banner
  4. Thomas LEBRUN
    Thomas LEBRUN avatar
    66 posts
    Member since:
    Sep 2009

    Posted 06 Nov 2009 Link to this post

    Nobody ? :(
  5. Thomas LEBRUN
    Thomas LEBRUN avatar
    66 posts
    Member since:
    Sep 2009

    Posted 08 Nov 2009 Link to this post

    Anyone got an idea ? Is this a not possible scenario ?


    Thanks !
  6. Kalin Milanov
    Admin
    Kalin Milanov avatar
    447 posts

    Posted 09 Nov 2009 Link to this post

    Hi Thomas,

    One possible solution to your case is to edit the templates of the rows and increase the width for the indicator as to allocate space for larger numbers. It is important to note that the change is best applied to all rows (Row, HeaderRow, GroupRow, FooterRow and GroupFooterRow) so that you will have no misalignments when grouping and/or showing totals.

    That being said we realize that this solution is not ideal since you can end up with 9 digit numbers or some other content which will require further customizations. We will discuss this issue internally in hope of providing a more streamlined approach to cases like this in the future.

    Greetings,
    Kalin Milanov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. Thomas LEBRUN
    Thomas LEBRUN avatar
    66 posts
    Member since:
    Sep 2009

    Posted 09 Nov 2009 Link to this post

    Hi,

    Thanks for your response. Do not forget to let me know of you find a better way to handle this [;)]


    Thanks !
Back to Top
DevCraft banner