简体   繁体   中英

Not able to assign multiple enums to single column of UltraWinGrid ValueList?

I ma beginner. I have a wingrid in which if single enum is assigned to column valuelist then it displays the enum name perfectly.

But when i assign multiple enums to the valuelist column it assign all cell values as numbers corresponding to enum value and only for

the last enum which was assigned to valuelist shows the enum value perfectly Below is the column having 3 rows and each row has different enum value eg Column A

   1 

   65

  EnumName

Above is column which shows the scenario happening, it show me numbers for all except for lastone, seems it is overriding the value list item and grid is able to display enum name only for the one declared last.

    e.Layout.Bands[0].Columns["Quantity"].ValueList = e.Layout.ValueLists["QuantityType"];
    e.Layout.Bands[0].Columns["Quantity"].ValueList = e.Layout.ValueLists["CrimEmpQuantityType"];
    e.Layout.Bands[0].Columns["Quantity"].ValueList = e.Layout.ValueLists["CrimCreditQuantityType"];

This code is written under grid initialize_Layout event Here QuantityType, CrimEmpQuantityType, CrimCreditQuantityType are my enums and column displays enum names for "CrimCreditQuantityType" and number for rest of enums. Is there any way i can assign multiple enum to valuelist of single column?? Or any other Can somebody pls help me on this?

The ValueList property of a column is only able to reference a single IValueList so when you are setting it multiple times you are replacing the reference that it points to. If you need to have a different set of values for individual rows you will need to set the ValueList on individual cells. If you have a value list that is used more than the others you could stil set that on to be the ValueList for the column and then use the other two instances as needed on individual cells.

There is an example of this in the API documentation for the UltraGridCell ValueList property .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM