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

[Solved] Last row as footer

2 Answers 227 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Iron
Iron
Iron
Daniel asked on 14 May 2009, 11:36 PM
Hi. I have a single page radgrid. Is there any way to render the last row as the footer?

Daniel

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 15 May 2009, 06:22 AM
Hello Daniel,

You can set the ShowFooter property of the grid to true inorder to display the footer row and then you can access cells in the footer row and copy the last row data onto the footer cells:
c#:
protected void RadGrid1_ItemDataBound (object sender, GridItemEventArgs e) 
    { 
      if (e.Item is GridFooterItem) 
        { 
            GridFooterItem footer = (GridFooterItem)e.Item; 
            GridDataItem dataItem = footer.OwnerTableView.Items[19];// where 19 = the last row index 
            footer["ColumnUniqueName"].Text = dataItem["ColumnUniqueName"].Text; 
            dataItem.Display = false// to hide the last row if required
        } 
    } 

Hope this helps..
Princy.
0
Daniel
Top achievements
Rank 1
Iron
Iron
Iron
answered on 18 May 2009, 04:56 AM
Thanks, that gets the job done.

Daniel
Tags
Grid
Asked by
Daniel
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Princy
Top achievements
Rank 2
Daniel
Top achievements
Rank 1
Iron
Iron
Iron
Share this question
or