Cannot set DataSource for nested Repeater

I am trying to create a nested repeater that uses the same BLL layer as the parent repeater.
I have a method which retrieves the data for the nested repeater based on the value of a field retrieved from the parent repeater by a button.
When the repeaters are separated everything works fine - the ItemCommand event of the parent repeater sends the value to the method and the child repeater(not nested) retrieves the correct data.  However when I move the child repeater inside the parent repeater,  Visual Studio complains that the repeater doesn't exist in the current context - intellisense doesn't recognize the child repeater or DataSource for it.

Help!!
LVL 1
mattfox77Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Anurag ThakurTechnical ManagerCommented:
mattfox77Author Commented:
I've amended my code to build the nested repeater datasource with a method,  but now I am getting an error on compile:

Error      6      No overload for method 'GetJobActivities' takes '0' arguments      

the method refers to a method in the BLL  which calls a tableadapter in the DAL


Code Behind:
protected JobActivities.taJobActivitiesDataTable allActs = null;
        protected JobActivities.taJobActivitiesDataTable GetJobActivities(string JobID)
        {
            if(allActs == null)
            {
            JobsBLL JobActLogic = new JobsBLL();
            allActs = JobActLogic.GetJobActivities();
            }
            allActs.DefaultView.RowFilter = "Job_CD = " + JobID;
            return allActs;
        }
 
Nested Repeater DataSource:
<asp:Repeater ID="repeaterChild" runat="server" DataSource='<%# GetJobActivities((string) Eval("Job_Cd")) %>' >
 
 
BLL Class Method:
 private taJobActivitiesTableAdapter _jobsAdapter = null;
        protected taJobActivitiesTableAdapter jAdapter
        {
            get
            {
                if (_jobsAdapter == null)
                    _jobsAdapter = new taJobActivitiesTableAdapter();
                return _jobsAdapter;
            }
        }
 
        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, false)]
        public JobActivities.taJobActivitiesDataTable GetJobActivities(string JobID)
        {
            return jAdapter.GetJobActivities(JobID);
        }

Open in new window

mattfox77Author Commented:
ragi0017:
I've read through the codeproject code you posted,  as well as many others similar - I'm not declaring my datasources in the code - Im using a 3 tier architecture,  and when I did try to use the example code,  I could not define the datasource for the nested repeater!! Im missing maybe a declaritive or something??
Anyway,  now Ive got it down to a method (previous attempts at this would not work but Im trying again anyway)  -got to get past the 0 arguments error!

Anurag ThakurTechnical ManagerCommented:
i am thinking that the error is not coming from your repeater but from the following line

allActs = JobActLogic.GetJobActivities();
i am saying so becasuse GetJobActivities always takes a parameter for jobid

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mattfox77Author Commented:
That's it!  I changed it to:
allActs = JobActLogic.GetJobActivities(JobID);
and it works!
thank you!

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.