Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8465127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:57:12+00:00 2026-06-10T14:57:12+00:00

I have a user control named ActivityGrid which takes a list of object as

  • 0

I have a user control named ActivityGrid which takes a list of object as a parameter in it’s constructor.

public ActivityGrid(List<clsActivityRow> ActivityData)
{
   bindData(ActivityData);
}

I need to bind this user control in a gridView called parentGrid, so I used Templatefield.

<asp:GridView ID="GridViewParent" runat="server" AutoGenerateColumns ="False">
<Columns>
   <asp:TemplateField>
      <ItemTemplate>
         <tr>
            <td colspan="100%">
               <uc1:ActivityGrid ID="ActivityGrid1" runat="server" />
            </td>
         </tr>
      </ItemTemplate>
   </asp:TemplateField>
</Columns>
</asp:GridView> 

How do I pass the list of object in this user control while it is
bound inside a gridview?

I have the list of object List<clsActivityRow> ActivityData ready in the code behind.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T14:57:13+00:00Added an answer on June 10, 2026 at 2:57 pm

    You need to find the ActivityGrid1 object in every row of GridViewParent in its RowDataBound event and assign datasource.

    protected void GridViewParent_RowDataBound(Object sender, GridViewRowEventArgs e)
    {           
            if (e.Row.RowType == DataControlRowType.DataRow)
            {                
              ActivityGrid ActivityGrid1= (ActivityGrid )e.Row.FindControl("ActivityGrid1");                    
                    if (ActivityGrid1 != null)
                    {
                        ActivityGrid1.DataSource = SomeMethodToReturnDataSource();                       
                        ActivityGrid1.DataBind();
                    }
             }          
    }
    

    or if your control has grid view i.e ActivityGrid1 has gridView1 then you can find gridView1 in ActivityGrid1

    protected void GridViewParent_RowDataBound(Object sender, GridViewRowEventArgs e)
    {           
            if (e.Row.RowType == DataControlRowType.DataRow)
            {                
              ActivityGrid ActivityGrid1= (ActivityGrid )e.Row.FindControl("ActivityGrid1");                    
                    if (ActivityGrid1 != null)
                    {
                        GridView gridView1 = (ActivityGrid )ActivityGrid1 .FindControl("gridView1");    
                        gridView1.DataSource = SomeMethodToReturnDataSource();                          
                        gridView1.DataBind();
                    }
             }          
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have wpf window named 'GetStarted' with grid which is perent of user control
I have user control named DateTimeUC which has two textboxes on its markup: <asp:TextBox
I have a user control named LettersDropControl. It has a dropdown list. I am
I am using an user control which have a button named 'btn_Save'.I need to
I have a user control which displays the currently logged in user's name. I
i have user control, which i render on several views. i want to show
I have a user control with several buttons, which need to take different actions
I have a user control called DashboardUserControl.ascx It has a function: public void setPagination(Boolean
I have a Windows form which hosts a custom User Control. This User Control
I have an user control named GraphPanel. It has two dependency properties, one custom,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.