Posted 30 May 2018, 11:57 am EST
Is it possible to have a dropdown menu inside a custom column field? In other words, for each Task / row, the user will see a dropdown menu in the cell where they can select the value for that cell?
Forums Home / ComponentOne / WinForms Edition
Posted by: jwhitney on 30 May 2018, 11:57 am EST
Posted 30 May 2018, 11:57 am EST
Is it possible to have a dropdown menu inside a custom column field? In other words, for each Task / row, the user will see a dropdown menu in the cell where they can select the value for that cell?
Posted 30 May 2018, 1:30 pm EST
Well, I totally forgot to include the control, etc. This question pertains to the WinForms GanttView control.
Posted 31 May 2018, 1:12 am EST
Hello Jeff!
Here, the trick is to show ComboList items of C1FlexGrid (which has been used as child control in GanttView controls) :
private void Form1_Load(object sender, EventArgs e)
{
C1FlexGrid gridView = c1GanttView1.Controls[2] as C1FlexGrid;
gridView.BeforeEdit += GridView_BeforeEdit;
}
private void GridView_BeforeEdit(object sender, RowColEventArgs e)
{
C1FlexGrid gridView = sender as C1FlexGrid;
gridView.BeginUpdate();
if(gridView.Cols[e.Col].Name == "CustomColumn1")
gridView.Cols[e.Col].ComboList = "A1|A2|A3|A4|A5";
gridView.EndUpdate();
}
In addition, below are few help links on C1FlexGrid :
Best regards,
Meenakshi
Posted 31 May 2018, 10:19 am EST
Thanks, I’ll give that a try.