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 4605106
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:23:13+00:00 2026-05-22T00:23:13+00:00

Goal: Display Encapsulate field from Player Problem: Want to display datamember_id , _name and

  • 0

Goal:

Display Encapsulate field from Player

Problem:
Want to display datamember_id, _name and _bust in class mainform only by using bindingList

Was it suppose to use syntax [] above the encapsulate field?


Class MainForm

    dataGridViewPlayers.AutoGenerateColumns=true;
    dataGridViewPlayers.AutoSizeColumnsMode=DataGridViewAutoSizeColumnsMode.Fill;

    bindingSourcePlayers.Clear();

    bindingSourcePlayers.DataSource = _myGameManager.Players;




Class GameManager:

    public BindingList<Player> Players
    {
        get
        {
            for (int i = 0; i < _myPlayerGUI_list.Count; i++)
            {
                _player.Add(new Player(_myPlayerGUI_list[i].Player));
            }
            return _player;
        }

    }

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CardGameClassLibrary;

namespace CardGameLib
{
    public class Player
    {

        private int _id;
        private string _name;
        private Hand _myHand;
        private int _win;
        private int _lost;
        private bool _madeMove = false;
        private bool _bust = false;


        public int Id
        {
            get { return _id; }
            set { _id = value; }
        }

        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        public Hand MyHand
        {
            get { return _myHand; }
            set { _myHand = value; }
        }

        public int Win
        {
            get { return _win; }
            set { _win = value; }
        }

        public int Lost
        {
            get { return _lost; }
            set { _lost = value; }
        }

        public bool MadeMove
        {
            get { return _madeMove; }
            set { _madeMove = value; }
        }

        public bool Bust
        {
            get { return _bust; }
            set { _bust = value; }
        }

        public Player(int pId)
        {
            _id = pId;

            _myHand = new Hand();
        }


        public Player(Player pPlayer)
        {
            _id = pPlayer.Id;
            //_name = pPlayer.Name;
            _name = "adsf";
        }


        public Player()
        {

        }



    }
}
  • 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-05-22T00:23:14+00:00Added an answer on May 22, 2026 at 12:23 am

    You can use Browsable() attribute to prevent specific properties from being shown in the DataGridView when usin BindingList.

    Example: if you want to hide MadeMove:

    [Browsable(false)]
    public bool MadeMove
    {
        get { return _madeMove; }
        set { _madeMove = value; }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Goal: Automatically display the first value from the enum Housing instead of displaying white
The final goal is to display a few kml overlays on one map and
I'm actually on a time performance project. The goal is to display a document
Here two of my model classes: class DashboardVersion(models.Model): name = models.CharField(_(Dashboard name),max_length=100) description =
Hii People, i want to set up a default exception handler for all application
Here's my canvas class extending JPanel : package start; import java.awt.Color; import java.awt.Graphics; import
Database table Language languageID (Primary key) language People <%: Html.DropDownList(SprakID, new SelectList(ViewData[Sprak] as IEnumerable,
I'm trying to implement a function that takes a System.Drawing.Bitmap object and renders it
I would like to implement an NSStatusItem where the title changes over time. My
I am having a hard time solving the following with an MVC view. My

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.