This is a migrated thread and some comments may be shown as answers.

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

1 Answer 271 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Matias
Top achievements
Rank 1
Matias asked on 23 Oct 2017, 11:43 PM

Hi!

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

is it possible?

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

Thanks!

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 24 Oct 2017, 09:50 AM
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.

Regards,
Dimitar
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.
Tags
GridView
Asked by
Matias
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or