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

Dynamic Calculated Column

2 Answers 128 Views
Grid
This is a migrated thread and some comments may be shown as answers.
MAH
Top achievements
Rank 1
MAH asked on 02 Mar 2012, 02:43 PM
Good morning

I have a requirement to calculate dynamically the difference between two times. I am currently facing a problem using RadGrid when I had implemented the requirement using RadDateTimePicker inside the RadGrid.

I want to calculate overtime hours dynamically in edit mode when the user changed [From] or [To] fields which are in type RadDateTimePicker, and the column which needs to calculated is TimeSpan. It works properly in read only mode, but i want to calculate it in edit mode too.

Is there any idea or method to solve this problem?

Thanks in advance

2 Answers, 1 is accepted

Sort by
0
Accepted
Antonio Stoilkov
Telerik team
answered on 07 Mar 2012, 10:08 AM
Hi Munner,

You could implement the desired functionality by subscribing to RadDateTimePicker OnSelectedDateChanged or ClientEvents-OnDateSelected depending if you need server-side or client-side implementation. Note that the RadDateTimePicker controls should be created in GridTemplateColumn so you could easily assign the events. In the event handler do your calculation and set the appropriate control values.

Additionally, you could go through the help article below for more information on how to access controls server-side in case you decide to implement it using server-side logic.

All the best,
Antonio Stoilkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
MAH
Top achievements
Rank 1
answered on 06 Apr 2012, 01:36 PM
Thanks alot !!
Tags
Grid
Asked by
MAH
Top achievements
Rank 1
Answers by
Antonio Stoilkov
Telerik team
MAH
Top achievements
Rank 1
Share this question
or