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

Deleting Items Programmatically

1 Answer 90 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michael Love
Top achievements
Rank 1
Michael Love asked on 01 Apr 2010, 11:13 PM
Hi there.

I have a report where I have a picture and a few textboxes in the report header. These items are only needed when the report is for a certain type of company. So, what I want to do check to see if it is that certain type of company, then delete/remove/hide those items programmatically. Is this possible? If so, where is the best place to do this?

Mike

1 Answer, 1 is accepted

Sort by
0
Michael Love
Top achievements
Rank 1
answered on 02 Apr 2010, 04:25 AM
I achieved the same result by checking for the condition in my group header data bound handler, then making the items not visible as such:

        void groupHeaderSection1_ItemDataBound(object sender, EventArgs e)  
        {  
            long contractorId = (long)this.ReportParameters["ContractorId"].Value;  
            long operatorId = (long)this.ReportParameters["OperatorId"].Value;  
 
            // If this is an Operator employee, make all contractor items invisible  
            if (contractorId == operatorId)  
            {  
                this.pbContractor.Visible = false;  
                this.tbContractorLabel.Visible = false;  
                this.tbContractorName.Visible = false;  
                this.tbContractorAddress.Visible = false;  
                this.tbContractorCityStateZip.Visible = false;  
                this.tbContractorPhone.Visible = false;  
            }  
        }  
 
Tags
General Discussions
Asked by
Michael Love
Top achievements
Rank 1
Answers by
Michael Love
Top achievements
Rank 1
Share this question
or