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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:37:19+00:00 2026-05-22T14:37:19+00:00

I am developing the windows based application in which i need to bind the

  • 0

I am developing the windows based application in which i need to bind the comboboxcolumns inside the datagridview with values from the [Attendance_type] table. And the datasource of this datagridview will be from [Employees table].

I am currently doing this using this code.

dgvEmployee.Columns.Clear();
                dgvEmployee.AutoGenerateColumns = false;

                DataGridViewTextBoxColumn branchcolumn = new DataGridViewTextBoxColumn();
                branchcolumn.DataPropertyName = "Name";
                branchcolumn.HeaderText = "Employee Name";
                branchcolumn.Name = "Name";
                branchcolumn.Width = 200;
                dgvEmployee.Columns.Add(branchcolumn);

                var metaattend = from Metaatt in dataDC.Metaattend
                                 where Metaatt.Status == true
                                 orderby Metaatt.Metaname
                                 select Metaatt;
                List<Metaattend> obj_ma = new List<Metaattend>();
                obj_ma = metaattend.ToList();

                var Empvar = from Emp in dataDC.Employees
                             join dept in dataDC.Dept on Emp.Deptid equals dept.Id
                             join branch in dataDC.Branch on Emp.Branchid equals branch.Id
                             where Emp.Status == true & Emp.Name.Contains(txtbranch.Text)
                             & (Emp.Deptid == Convert.ToInt64(cmbDept.SelectedValue) | cmbDept.SelectedValue.ToString() == "0")
                             & (Emp.Branchid == Convert.ToInt64(cmbBranch.SelectedValue) | cmbBranch.SelectedValue.ToString() == "0")
                             orderby Emp.Name
                             select new { Emp.Id, Emp.Name };
                DataTable dt_employee = new DataTable();
                using (clsGeneral obj_gen = new clsGeneral())
                {
                    dt_employee = obj_gen.LINQToDataTable(Empvar);
                }
                dgvEmployee.DataSource = dt_employee;


                string[] datemonth = cmbMonth.Text.Split('-');
                int i = DateTime.DaysInMonth(Convert.ToInt32(datemonth[1]), GetMonthNo(datemonth[0]));
                for (int j = 0; j < i; j++)
                {
                    DataGridViewComboBoxColumn daycomboColumn = new DataGridViewComboBoxColumn();
                    daycomboColumn.HeaderText = (j + 1).ToString();
                    daycomboColumn.Width = 50;

                    daycomboColumn.DataSource = obj_ma;
                    daycomboColumn.DisplayMember = "Metaname";
                    daycomboColumn.ValueMember = "Id";
                    dgvEmployee.Columns.Add(daycomboColumn);
                }

Using this the code is executed successfully, but the form does not shows me any record in the column for combobox inside the datagridview.

This is the view of my form, when i click on the comboboxes then also it does not shows me anything.

enter image description here

I have seen many post about this but none was helpfull for me. As that all shows me the same thing that i have done.

Please help be with about where i have done the mistake.

Thanks

  • 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-22T14:37:20+00:00Added an answer on May 22, 2026 at 2:37 pm

    Enable Row Editing property for the datagridview was set to false. so it was not showing the Data inside the combobox.

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

Sidebar

Related Questions

Which use of connection management is better while developing a windows based application which
I have a tab-based application for windows, which I am developing by myself. I
I am developing a Window-based application in which, I added tabBarController and have table
I am developing a Windows .NET application (WinForms) and I need to simulate a
I am developing an iPhone application which is navigation based. Whenever the application quits,
I am developing an application which is web-based (asp.net MVC). The user configures reminders
I am developing C# windows based application. I am getting System.ComponentModel.Win32Exception: Access is denied
I'm developing a compact framework 3.5 application on a windows CE based scanner device.
I am developing a windows based application using C#. This should be used by
I'm developing an asp.net application which has Windows Authentication enabled(anonymous access disabled). I've created

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.