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

[Solved] Calculating a percentage between 2 columns and creating a new column

1 Answer 241 Views
Grid
This is a migrated thread and some comments may be shown as answers.
DogEars
Top achievements
Rank 2
DogEars asked on 03 Mar 2008, 02:29 AM
I was wondering if it was possible to do a quick calculation between 2 columns of a RadGrid and then store the result for that row in a 3rd column as a percentage?

Any samples or advice would be appreciated.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 04 Mar 2008, 08:26 AM
Hello DogEars,

To achieve this you can use additional template column where you can set desired value using ItemDataBound. Here is an example:

if(e.Item is GridDataItem)
{
    (e.Item as GridDataItem)["YourTemplateColumnUniqueName"].Text = "myvalue";
}

You can access data-item bound to the grid item using e.Item.DataItem.

Sincerely yours,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
DogEars
Top achievements
Rank 2
Answers by
Vlad
Telerik team
Share this question
or