0

我正在编写一份 Telerik 报告。在我的报告中有三个文本框(textBox14、textBox15、textBox16)。

在 textBox14 和 15 中,根据总和组标准显示来自数据源的值的总和。我想在 16 中显示 textBox14 和 15 值的总和。如何在 textBox16 的 ItemDataBinding 或 ItemDataBound 事件中获取 textBox 14 和 15 的值。

private void textBox16_ItemDataBound(object sender, EventArgs e)
    {
        string amt= textBox14.Value;  // It getting only the mapped field name. ie Fields.amt, but I want the display text of the textBox14. There is no .Text property  for textBox14.

        string tax= textBox15.Value; // It getting only the mapped field name. ie Fields.tax, but I want the display text of the textBox14. There is no .Text property  for textBox15.


    }

我想将 textBox16 值设置为

textBox16.Value = Convert.ToString(ConvetToInt32(amt) + ConvetToInt32(tax)); 

我怎样才能得到这些值?

4

2 回答 2

0
 private void textBox16_ItemDataBound(object sender, EventArgs e)
        {
            string amt = textBox14.Text;  
            string tax = textBox15.Text; 
        }

然后调用:

 textBox16.Text = Convert.ToString(Convert.ToInt32(amt) + Convert.ToInt32(tax));
于 2013-11-06T07:00:29.507 回答
0

你为什么不试试 detail_ItemDataBound 事件

private void detail_ItemDataBound(object sender, EventArgs e)
{
    Telerik.Reporting.Processing.DetailSection section = (sender as Telerik.Reporting.Processing.DetailSection);
    Telerik.Reporting.Processing.TextBox = (Telerik.Reporting.Processing.TextBox)Telerik.Reporting.Processing.ElementTreeHelper.GetChildByName(section, "textBox14");
    Telerik.Reporting.Processing.TextBox = (Telerik.Reporting.Processing.TextBox)Telerik.Reporting.Processing.ElementTreeHelper.GetChildByName(section, "textBox15");
    Telerik.Reporting.Processing.TextBox txtTotal = (Telerik.Reporting.Processing.TextBox)Telerik.Reporting.Processing.ElementTreeHelper.GetChildByName(section, "textBox16");
    txtTotal.Value = (Convert.ToInt32(txtAmt.Value) + Convert.ToInt32(txtTax.Value)).ToString();
}
于 2013-11-12T17:28:43.997 回答