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

Access Textbox in detail section ItemDataBound

2 Answers 467 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Justin McMillen
Top achievements
Rank 1
Justin McMillen asked on 18 May 2010, 05:57 PM
I'm trying to use the approach mentioned in the following article to get textbox values:

http://www.telerik.com/help/reporting/using-section-events.html


I'm getting the following error:

Error   1   Cannot implicitly convert type 'Telerik.Reporting.Processing.ProcessingElement' to 'Telerik.Reporting.Processing.ReportItemBase'. An explicit conversion exists (are you missing a cast?)  

What am I doing wrong?

private void detail_ItemDataBound(object sender, EventArgs e) 
        { 
            Telerik.Reporting.Processing.DetailSection section = sender as Telerik.Reporting.Processing.DetailSection; 
            Telerik.Reporting.Processing.ReportItemBase extraShipping = section.ChildElements.Find("extraShippingCostTextBox", false)[0]; 
        } 


2 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 20 May 2010, 11:46 AM
Hello Justin,

Thank you for reporting this issue. We have updated the help article and the update will be published with the next upload of the online help. Check out the following working code snippet:

private void detail_ItemDataBound(object sender, EventArgs e)
{
    
    Telerik.Reporting.Processing.DetailSection section = (sender as Telerik.Reporting.Processing.DetailSection);
    Telerik.Reporting.Processing.TextBox extraShipping = (Telerik.Reporting.Processing.TextBox)section.ChildElements.Find("extraShippingCostTextBox", false)[0];
    object val = section.DataObject["Weight"]; 
       
    if (!(val is DBNull) && (Convert.ToDecimal(val)) > 10)
    {
        extraShipping.Visible = true;
    }
    else
    {
        extraShipping.Visible = false;
  
    }
}

As a token of gratitude we have updated your Telerik Points.

Regards,
Peter
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Mohammed
Top achievements
Rank 2
answered on 23 Mar 2013, 04:11 AM
how can i access a textbox in a group section from data binding event of textbox in the detail section ?
Tags
General Discussions
Asked by
Justin McMillen
Top achievements
Rank 1
Answers by
Peter
Telerik team
Mohammed
Top achievements
Rank 2
Share this question
or