views:

839

answers:

2

hi i have added the drop down list to the ultra web grid column and saved the value selected in the drop down to the database and when i try to retrieve the data and display the data its showing the value of the dropdown not the text e.g. 4001 - sales it is showing 4001 not sales i want to show the sales text in the drop down how to achieve this

+1  A: 

This code works for me:

ultraGridValueList.ValueListItems.Add("ValueMemeber1", "DisplayMemeber1"); ultraGridValueList.ValueListItems.Add("ValueMemeber2", "DisplayMemeber2"); ultraGridValueList.ValueListItems.Add("ValueMemeber3", "DisplayMemeber3"); ultraGridValueList.ValueListItems.Add("ValueMemeber4", "DisplayMemeber4");

ultraGrid1.DisplayLayout.Bands[0].Columns["myDropDownCol"].ValueList = ultraGridValueList;

Mosquito Mike
A: 

I had a similar problem where I had a grid and when I clicked an "Add" button to add a new row, the existing rows would show the ID in the drop downs instead of the Display Text. What fixed it was to set the DataType on the drop down column to the type of the ID (in my case, System.Int32). Hope that helps.

colour me brad