To reproduce:
- Add two GridViewMultiComboBoxColumns with different number of columns to a grid.
- set AutoSizeDropDownToBestFit to true in the CellEditorInitialized event.
- Start the project and open the drop down for the first column and then for the second.
- You will notice that the second time the drop down size is not calculated properly.
Workaround:
void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
RadMultiColumnComboBoxElement el = e.ActiveEditor as RadMultiColumnComboBoxElement;
if (el != null)
{
FieldInfo propertyInfo = el.GetType().GetField("savedColumnsWidth", BindingFlags.NonPublic | BindingFlags.Instance);
propertyInfo.SetValue(el, -1);
el.AutoSizeDropDownToBestFit = true;
}
}