For Each c In Me.DataGridView1.Columns
c.SortMode = DataGridViewColumnSortMode.NotSortable
Next
This is the DataGridView handler you need to capture the button click event.
this.dgvList.CellContentClick += new DataGridViewCellEventHandler(DGV_CellContentClick);
This is the button click handler example
#region DGV_CellContentClick
public void DGV_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
int selectedRowIndex = int.Parse(e.RowIndex.ToString());
if (this.dgvList.Columns[e.ColumnIndex] == buttonColumn && selectedRowIndex >= 0)
{
DataRow dr = DataGridViewHelper.GetDataRow(this.dgvList);
MessageBox.Show((string)dr["FirstName"]);
}
}
This blog related to all the experience that i gain and face during past career. It covers Microsoft technology like. Microsoft Dot Net, SQL Server, Scripting Language etc,.
Pages
Friday, April 15, 2011
Subscribe to:
Post Comments (Atom)
My Blog List
-
-
-
-
Kumaon University Nainital B.Ed entrance exam test result 2012 - कुमाऊँ विश्वविधालय, नैनीताल (उत्तराखण्ड)11 years ago
No comments:
Post a Comment