DataGridViewButtonColumn btn = new DataGridViewButtonColumn(); ListCards.Columns.Add(btn); btn.HeaderText = "Status"; btn.Text = "Status"; btn.Name = "btn_status"; ListCards.Columns[1].Name = r.GetString("CardInfo"); ListCards.Columns[2].Name = r.GetString("StartDayD"); ListCards.Columns[3].Name = r.GetString("EndDayD"); ListCards.Columns[4].Name = r.GetString("ExecuteDay"); ListCards.Columns[5].Name = r.GetString("Username"); ListCards.Columns[6].Name = r.GetString("Mobile"); ListCards.Columns[7].Name = r.GetString("IdUser"); <pre lang="cs">string[] row = new string[] {obj.CardInfo, start_day, end_day, execute_day, obj.Username, obj.Mobile, Id_User, btn }; ListCards.Rows.Add(row);</pre></pre>
dataGridView1.Columns.Add(new DataGridViewButtonColumn() { Name="ColumnName", HeaderText="Header" // add here properties for the new column } );
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)