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

how to show the sum of two diffrent text box value in another textbox

1 Answer 475 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Peng
Top achievements
Rank 1
Peng asked on 10 Jan 2014, 07:29 PM
Hi

i want to show the sum of two different textbox value in third textbox
textBox1 coming from datasource1
textBox2 coming from datasource2

i try to itemDatabinding but it just show the field.total as string not value as show attached picture

can any one help me on this??

1 Answer, 1 is accepted

Sort by
-1
KS
Top achievements
Rank 1
answered on 15 Jan 2014, 03:17 PM
Hi,

Put the tables to be before the text box with the grand total and rely on the order of processing.

  private void granTotalInTheGroupFooter_ItemDataBinding(object sender, EventArgs e)
        {
            var tb = sender as Telerik.Reporting.Processing.TextBox;
            var totalTB1 = Telerik.Reporting.Processing.ElementTreeHelper.FindChildByName(tb.Report, "tbTotalTable1", true)[0] as Telerik.Reporting.Processing.TextBox;
            var totalTB2 = Telerik.Reporting.Processing.ElementTreeHelper.FindChildByName(tb.Report, "tbTotalTable2", true)[0] as Telerik.Reporting.Processing.TextBox;

            tb.Value = Convert.ToInt32(totalTB1.Value) + Convert.ToInt32(totalTB2.Value);
        }


-KS
Tags
General Discussions
Asked by
Peng
Top achievements
Rank 1
Answers by
KS
Top achievements
Rank 1
Share this question
or