Hi Guys okay so i have a database for this we will use a simple database.txt as reference
Text Database For Population
Peter,Pan
James,Dean
Hal,lo
Calc,exe
Mad,Hatter
Patterson,Matthiew
I want to be able to add a button containing for example
[Peter] , [James], ext ext
For Each Read Out Of The Database How Would I Pressure the population in this instance considering i have to create a button for each new name that is read from the database
Thanks In Advance
P.S. Initially i Used a dropdown with the following code
List<MDB.Userdb> packObjects = new System.Collections.Generic.List<MDB.Userdb>();
string colname = "UserRef";
try
{
packObjects = MDB.User.RetrieveList();
if (!dgvData.Columns.Contains(colname))
{
DataGridViewComboBoxColumn cb = new DataGridViewComboBoxColumn();
cb.DataPropertyName = colname;
cb.Name = colname;
cb.HeaderText = colname;
cb.DataSource = packObjects;
cb.ValueMember = "Idx";
cb.DisplayMember = "UserName";
dgvData.Columns.Add(cb);
}
else
{
//refresh data in drop down
DataGridViewComboBoxColumn ocb = (DataGridViewComboBoxColumn)dgvData.Columns[colname];
ocb.DataPropertyName = colname;
ocb.Name = colname;
ocb.HeaderText = colname;
ocb.DataSource = packObjects;
ocb.ValueMember = "Idx";
ocb.DisplayMember = "UserName";
}
}
catch (Exception ex)
{
MessageBox.Show("Unable to Retrieve User Detials " + ex.Message, "Retrieve User Detials", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
Notes: WinForms c# .Net4.0