Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
333
Appearance from an selected ValueList item
posted

Hi,

i have a UltraWinGrid with one dropdonwlist-column containing a ValueList with items in different colors.

I have used the Designer to fill the ValueList ;-).

Now i want to change the row selector appearence depending on the color of the current selected ValueListItem.

My not working solution looks like this:

this.grdSalesUntis.CellChange += (sender, args) =>
                {
                    var cell = args.Cell;
                    if (cell == args.Cell.Row.Cells[SalesUnitMetadata.PropertyNames.OppStatus])
                    {
                        var item = cell.ValueListResolved.SelectedItemIndex;
                        var listItem = ????????;
                        var appereance = listItem.Appearance;
                    }
                };

Where can i get the ValuListItem object with all properties?

Thanks for your help!

Stephan

Parents
  • 333
    Verified Answer
    Offline posted

    Sometimes thinking about helps ;-)

    this.grdSalesUntis.CellChange += (sender, args) =>
                    {
                        var cell = args.Cell;
                        if (cell == args.Cell.Row.Cells[SalesUnitMetadata.PropertyNames.OppStatus])
                        {
                            var item = cell.ValueListResolved.SelectedItemIndex;
                            var lists = grdSalesUntis.DisplayLayout.ValueLists;
                            var myList = lists["OppStatus"];
                            var listItem = myList.ValueListItems[item];
                            var appereance = listItem.Appearance;
                            cell.Row.RowSelectorAppearance.BackColor = appereance.BackColor;
                        }
                    };

Reply Children
No Data