I am using a normal Datagridview but I have a problem with it.
This way I am filling data in my grid and adding combobox column to it
db.DataEntities ss = new db.DataEntities();
DataGridview1.DataSource = ss.table1.ToList();
if (!DataGridview1.Columns.Contains("dgcolUser"))
{
DataGridViewComboBoxColumn dgcombocolUser = new DataGridViewComboBoxColumn();
dgcombocolUser.Name = "dgcolUser";
var listOfAllUsers = ss.secAccountInformations.ToList();
dgcombocolUser.DataSource = listOfAllUsers;
dgcombocolUser.DisplayMember = "AccountName";
dgcombocolUser.ValueMember = "UserId";
DataGridview1.Columns.Add(dgcombocolUser);
}
foreach ( DataGridViewRow dgr in DataGridview1.Rows)
{
dgr.Cells["dgcolUser"].Value = dgr.Cells["PermittedUserId"].Value;
}
I am opening this Form in a MDI parent
Form1 frm = new Form1() { MdiParent = MdiForm1};
frm.Show();
when I open my form it not displaying any selected value in Comboboxcolumn
But when I open my Form frm1 not it MdiParent it display selected value in Comboboxcolumn
Form1 frm = new Form1();
frm.Show();
so is this really happen because it shows data when i am showing my form without MdiParnet or is there any other reason due to which it is not happening<br>
Please give me better suggesstion.. because showing form without MdiParent is not valid solution.