Hi,
I have a grid where i want to display three columns
CUSTOMER, PART and DISCOUNT
The valuelist belongs to PART.
As I assign rows to each CUSTOMER i need the valuelist of PART to only display items that have not yet been selected.
So if i have 3 parts in the database
INFRA PART1 10%
INFRA PART2 20%
when i drop down that cell to add the third row i only want to show PART3. If i was setting up a new customer then all three parts would show.
What is the best way to achieve this? I tried using the beforecellist drop down event to reset the valuelist but was not having any luck.
Thanks.
I would probably use something like the approach described here:
Creating a dropdown list in a grid cell whose list values are dependent on another cell - Windows Forms - Infragistics Community
This approach shows how to base the items on the list on some other cell value in the same row, which is not really what you want. But you do want to do something similar and filter the list based on which row you are dropping down, so it's very close. The only tricky part will be looping through the grid rows and determining which rows to filter out of the list.
Who owns the value list?
Is it the band
grid.DIsplayLayout.Bands[0].Columns["column"].ValueList
or the cell
e.cell.ValueList
or are they sepearte?
In my approach, the ValueList (or the UltraDropDown control in this case) is attached to the column. I am populating the list with all possible values and then filtering the list, using the UltraDropDown's filtering capabilities based on the current row in the grid.