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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:35:56+00:00 2026-06-11T17:35:56+00:00

i have a data gridview with 4 columns first 2 columns are combobox columns,

  • 0

i have a data gridview with 4 columns first 2 columns are combobox columns, third column is textbox column and 4th column is button column.In form load i have to disable the entire button column of datagrid and after this i should select first three columns and save these first three columns in database after saving this the button column in the particular row should enable.first three columns should be saved in databese by clicking a button.
Please help me im struck up with this problem from many days
here is the code which i used

private void SATAddTemplate_Load(object sender, EventArgs e)
{
           foreach (DataGridViewRow row in datagrdADDTEMP.Rows)
           {

               DataGridViewButtonCell btn = (DataGridViewButtonCell)row.Cells[3];
               btn.ReadOnly = true;
           }
}
 private void btnSaveSettings_Click(object sender, EventArgs e)
     {
           foreach (DataGridViewRow row in datagrdADDTEMP.Rows)
           {

               DataGridViewButtonCell btn = (DataGridViewButtonCell)row.Cells[3];
               btn.ReadOnly = false;
           }
     }
  • 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-11T17:35:58+00:00Added an answer on June 11, 2026 at 5:35 pm

    Here’s some help with the problem of setting the Enabled property of the Buttons that appear in a DataGridViewButtonColumn.

    You’ll need to extend DataGridViewButtonColumn to create your own DataGridView column with disable-able buttons. This article on MSDN details how to do this.

    The article has a lot of code, and I encourage you to take a close look, but all you really need to do is copy and paste into your project the following classes found in the article:
    — DataGridViewDisableButtonColumn
    — DataGridViewDisableButtonCell

    Once you do this you will be able to add DataGridViewDisableButtonColumns to your DataGridView. Use the public Enabled property exposed in your custom column to set the Enabled property of each cell’s Button control. Since you want to set the Enabled property of all the Buttons in the column you can write a helper method that loops through all rows in your DataGridView and sets the Enabled property:

    private void SetDGVButtonColumnEnable(bool enabled) {
        foreach (DataGridViewRow row in dataGridView1.Rows) {
            // Set Enabled property of the fourth column in the DGV.
            ((DataGridViewDisableButtonCell)row.Cells[3]).Enabled = enabled;
        }
        dataGridView1.Refresh();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have gridview which has columns of data and a button below the Apply
I have DataGridView with two columns. The first column is TextBoxCol(DataGridViewTextBoxColumn) and the Second
I have ListView that uses a GridView to display several columns of data. Two
I have an ASP.NET GridView that has four columns. The first three are typical
I have a unbound DataGridView with two columns. First column is just string values.
Im working on asp.net with c#. I have a gridview with templatefield columns, data
In my first load of my aspx page, I have a GridView that are
I have added a button column to a gridview. I am populating the gridview
I have datagridview with checkbox column, but I want, that some of the columns
I have a DataGridView in a windows form. I defined 5 columns for this

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.