Hello,
I use iGrid's dropdown control in one of iGrid columns. This column displays an enumeration (stored in cell.Value) as text associated with the dropdown control's iGDropDownListItem (so iGDropDownListItem.Value = cell.Value, iGDropDownListItem.Text = cell's display text). This works well if the dropdown list items are the same for each row. However, my dropdown list must have specific items depending on the selected grid row, so I refill the dropdown list in SelectionChanged event of the grid. Because the grid stores the selected iGDropDownListItem item in AuxValue, it cannot match this AuxValue to one of the new items (because I add different iGDropDownListItem objects to the list with the same Value and Text properties), and when I drop down the list the current cell value is not automatically selected from among the dropdown list items. I tried creating a custom class which inherits iGDropDownListItem and implementing its CompareTo method:
class GridDropDownListItem : iGDropDownListItem, IComparable<GridDropDownListItem>, IComparable
{
public int CompareTo(GridDropDownListItem other)
{
if (other == null) return 1;
return Mode.CompareTo(other.Mode);
}
public int CompareTo(object obj)
{
var item = obj as GridDropDownListItem;
if (item == null) return 1;
return CompareTo(item);
}
}
However this does not work: the grid displays enumeration text instead of iGDropDownListItem.Text and the value is not selected from dropdown list items.
Can you help?
Thank you!
Best regards,
Stanislav