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

Radgrid Numericcolumn

1 Answer 73 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Prathap Narravula
Top achievements
Rank 1
Prathap Narravula asked on 26 Sep 2010, 10:33 AM
Hi,

I am having a radgrid with  a radnumeric column to display amount. 
In Radnumeric column i am displaying total in footer of that column. 

The problem is i need to store that total amount to a variable as i need that amount for some calculation.

Please help me in this issue. 

Need urgent help

Regards,
Prathap Narravula   

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 27 Sep 2010, 05:23 AM
Hello Prathap,

You can access the cell value of footer item using ColumnUniqueName and store it in a variable like below.

ASPX:
<telerik:GridNumericColumn DataField="Amount" UniqueName="Amount" Aggregate="Sum" />

C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
   {
       if (e.Item is GridFooterItem)
       {
           GridFooterItem footerItem = (GridFooterItem)e.Item;
           string[] words = footerItem["Amount"].Text.Split(':');
           int total = Convert.ToInt32(words[1].ToString());
       }
   }

Thanks,
Princy.
Tags
Grid
Asked by
Prathap Narravula
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or