Add custom text to last row (Total row) in Gridview

2 posts, 1 answers
  1. Matias
    Matias avatar
    4 posts
    Member since:
    Sep 2017

    Posted 23 Oct 2017 Link to this post


    I'd like to add a custom text at the bottom of my gridview, I attach a screenshot of what I'm looking for..

    is it possible?

    Also, how can I format the number to have the thousands comma separator?


  2. Answer
    Dimitar avatar
    2933 posts

    Posted 24 Oct 2017 Link to this post

    Hi Matias,

    You can use the ViewCellFormatting event to add text to the empty summary cells. For example:
    private void RadGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
        if (e.CellElement is GridSummaryCellElement && e.ColumnIndex == 1 )
            e.CellElement.Text = "Test";

    To add a thousand separator set the format string of the summary item like this:
    summaryItem.FormatString = "{0:n}";

    I hope this will be useful. Let me know if you have additional questions.

    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top