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

  • Home
  • SEARCH
  • 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 8014071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:49:18+00:00 2026-06-04T19:49:18+00:00

I have the following code which should bind some data to a gridview but

  • 0

I have the following code which should bind some data to a gridview but its not working.

THe district manager object has a Brand.
As you can see in the screenshot the brand is correctly filled in with data.

 private void LoadData()
        {
            List<DealerDistrictManager> listDealerDistrictManager = DistrictManagerBL.GetAllDealersWithDistrictManagers();
            DistrictManagersGrid.DataSource = listDealerDistrictManager;
            DistrictManagersGrid.DataBind();


     <asp:BoundColumn DataField="DistrictManagerId" Visible="False"></asp:BoundColumn> 
        <asp:BoundColumn DataField="Brand.Name" meta:resourcekey="BrandHeader"></asp:BoundColumn>


 public class DealerDistrictManager
    {
        public int DistrictManagerId { get; set; }
        public string Nuteres { get; set; } 
        public string DealerNumber { get; set; }
        public virtual Brand Brand { get; set; }
        public int DistrictNumber { get; set; }
        public string Name { get; set; }
    }

 public class Brand
    {
        public int BrandId { get; set; }
        public string Name { get; set; }
    }

Update1

public List<DealerDistrictManager> GetAllDealersWithDistrictManagers()
    {

            return  (from d in _context.Dealers
                      from m in _context.DistrictManagers
                      where d.Nuteres == m.DealerNuteres
                     select new DealerDistrictManager
                                { 
                                    DistrictManagerId= m.DistrictManagerId,
                                    Nuteres = d.Nuteres,
                                    DealerNumber = d.DealerNumber,
                                    Brand  = m.Brand,
                                    DistrictNumber = m.DistrictNumber,
                                    Name = m.Name

                                 }).ToList<DealerDistrictManager>(); 

    }

enter image description here

  • 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-04T19:49:19+00:00Added an answer on June 4, 2026 at 7:49 pm

    This post also speaks about the same / similar problem. Where it “randomly” occurs. The solution that the questioner found was to use:

    <%#Eval("contentsection.Id") %>
    

    The post mentioned has a lot of answers (including an accepted one) that will clarify a lot I presume.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code which should make drawFrame be called every frame but
I have the following code which should put programs startable in Bash. if [
I have following code: os.chdir(os.path.dirname(os.path.realpath(__file__)) + /../test) path.append(os.getcwd()) os.chdir(os.path.dirname(os.path.realpath(__file__))) Which should add /../test to
I have the following lines of php code which should rename a file which
I have the following code, which should adds a field to a form if
I have following code which works for radio buttons but need to be changed
I have the following code which should be inserting into the database x amount
I have the following C# code which should match a quantity / $ price
Ok, firstly I have the following code working.. although my question is this; should
I have the following code which should update a label to say please wait..,

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.