Home Forums WinForms controls Xceed Grid for WinForms Populating GridComboBox on activate Reply To: Populating GridComboBox on activate

User (Old forums)
Member
Post count: 23064

Here’s how I did it:

private void DataRowTemplate_BeginningEdit(object sender, CancelEventArgs e)
{
GridComboBox gcb = ((GridComboBox)((CellRow)sender).Cells[3].CellEditor.Control);
gcb.Items.Clear();
DataSet ds = ws.GetMilestones(Convert.ToInt32(((CellRow)sender).Cells[5].Value.ToString().Split(‘%’)[1]));

gcb.BeginUpdate();

foreach(System.Data.DataRow dr in ds.Tables[0].Rows)
{
gcb.Items.Add(dr[2].ToString());
}

gcb.EndUpdate();
gcb.SelectedIndex = gcb.FindString(((CellRow)sender).Cells[3].Value.ToString());
}

Imported from legacy forums. Posted by EasyRhino (had 3982 views)