articles

Home / DeveloperSection / Articles / How to add button in DataGridView in CSharp .NET

How to add button in DataGridView in CSharp .NET

How to add button in DataGridView in CSharp .NET

Anonymous User 15150 27-Jul-2010

To add button in DataGridView we have write the following code.

DataGridViewButtonColumn btnDGV= new DataGridViewButtonColumn();
//creating object of datagridview button.           
      btnDGV.Name = "Click";
//setting name of button to click
btnDGV.HeaderText = "Click";
//setting column title to click
      btnDGV.Text = "Click";
//setting button text to click
      btnDGV.UseColumnTextForButtonValue = true;
//this will enable button to show text

 

Now adding button to DataGridView

dgRecord.Columns.Add(btnDGV);

 

How to add button in DataGridView in CSharp .NET

c# c# 
Updated 04-Mar-2020
I am a content writter !

Leave Comment

Comments

Liked By