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
570
Column Value List not picking up values
posted

Has anyone had any issues using Values Lists at the column level?

I have created the following ValueLists

lsAssetClass = (from a in DataBaseManager.Core.AssetClassselect a).ToList<AssetClass>(); //creates a list of LINQ objects

 

vAssetClass = lsAssetClass.ToValueList(

"AssetClassDesc", "AssetClassCode");

//Custom extension method used to create a value list

lsPortSubCat = (from pcat in DataBaseManager.Core.PortfolioSubCategory select pcat).ToList<PortfolioSubCategory>();

vPortSubCat = lsPortSubCat.ToValueList(

"PortSubCategoryDesc", "PortSubCategoryCode");

//Then I'm setting the ValueList properties of each column on the Initialize Layout event

 

e.Layout.Bands[0].Columns[

"AssetClassDesc"].ValueList = ValueLists.vAssetClass;

 

 

e.Layout.Bands[0].Columns[

"PortfolioCategoryDesc"].ValueList = ValueLists.vPortSubCat;

//Everything works fine except for when I try to access the values in the lists

 

string

 

asset = (string)dgSecuritySetup.Rows[0].Cells["AssetClassDesc"].Value;

 

string port = (string)dgSecuritySetup.Rows[0].Cells["PortSubCategoryDesc"].Value;

/*The issue is that "asset" ends up being the correct  value (i.e If I see "Equity" on the grid, I get its code ("EQ") when I access the cell value, as expected. When I try to do the same for "port" I always get back the displayed text rather than the corresponding value in the value list (i.e I get "Long-Spec" when I should get "LNGSPEC"). I double checked to make sure the Value List was still set when I tried to access the cell value (which it was) and I double checked the ValueList to make sure the display text/data values were set up correctly (which they are, "Long-Spec" maps to "LNGSPEC") */

The UltraGrid is using row layouts and each column style is DropDownList.

Any ideas? This seems like a bug.....