I'm using Ultradropdown for the valuelist some columns of my UltraGrid. I'm also setting the EditorControl to UltraComboEditor for some other columns. The DisplayMember and ValueMember properties of the UltraDropDown and UltraComboEditor have been set correctly. When the form loads, the grid shows the values in the ValueMember in these cells. When I simply hover the mouse over these cells, the grid corrects itself to show the values of the DisplayMember. The grid behaves correctly when I click on a dropdown. It shows me the values in the displaymember. Can someone tell me why the grid defaults to the values in the ValueMember instead of DisplayMember when it loads?
Okay, that makes perfect sense. If you change the SubCategoryID list based on the Category, then there will be some rows in the grid whose Value does not match any items on the list, so it can't display the proper display text.
There are a couple of ways to handle this. One way would be to assign the ValueList or UltraDropdown to the Cell, rather than the entire column. This way each cell in the SubCategoryID column can have a different list with the appropriate values on it for the selected category. The tricky part about this is that if you have a lot of rows, you will end up creating a whole lot of lists. So you would probably want to cache the ValueLists and re-use the same list for rows that have the same category.
An alternative method is to use UltraDropDown instead of a ValueList and populate the list with all possible SubCategoryIDs. Then you use ColumnFilters on the UltraDropDown to filter out the items that don't match the Category.
Mke, thanks for your response. I found the source of the problem. Thought I'll post what resolved the issue in case it helps anyone. If you have a better way of doing it, please suggest... One thing I find about Infragistics controls is that they have too many properties and events and its tough to choose what to use... and what would be the best way of doing something...
I have a ultragrid which has columns called CategoryID, SubcategoryID and EventID (in addition to other columns). I show the Category Name, the Subcategory Name and the Event Name and not the ID's during display in the grid. The valuelists for these columns are set to Ultradropdown or a ComboEditor. The values in the dropdown for SubcategoryID and EventID are dependent on the CategoryID chosen for that row. I use the ultraGrid1_BeforeCellListDropDown event to populate the datasource for subcategories and events when that cell is clicked. What was happening was that the rows that had a category other than the active row were losing the display for Subcategory Name and Event Name as the datasource for the drop down list was now only a subset for the category of the active row. What I am doing now is that in the ultraGrid1_AfterCellListCloseUp event, I'm resetting the datasource for the dropdownlists to all the subcategories and events. This has resolved the issue.
There are a number of possibilities. One is that something is wrong with the Data types. Perhaps the DataType of the ValueMember field in the list doesn't match the datatype of the grid column.
Another possibility is that there's some sort of timing problem in the order in which you are applying the data sources of the grid and the dropdowns.