I have a grid set up with some cells set to style = dropdownvalidate with some valuelists behind them. They work perfectly unless I set a value at run-time before showing the grid. If I do this, and you try to change the value using the dropdown, it will change but then after the cell loses focus, the value reverts back to the original. I've messed with this for a while now and am stumped.
No, that is real code, the line above it is where it is checking the other Cell Value.
If e.Row.Cells(0).Value = "LocationId" Then e.Row.Cells(1).ValueList = LoadValueList("Location")
The LoadValueList function creates and passes back a ValueList based on the string that was passed in. There are 5 other If statements checking for the other types that may be used.
Oh, okay. This line threw me off:
e.Row.Cells(1).ValueList = LoadValueList("Location")
But I guess that was just for posting, not your real code. :)
The ValueList(s) are based on row specific information. Depending on what Value is in Cell(0) a ValueList is loaded in Cell(1). In the code snippet above, I only show one of the loads, for Locations. There are 5 other ones for Employees and several other 'Types' lists.
Hi Chip,
Out of curiosity... why are you populating the ValueList inside of InitializeRow, anyway? It doesn't appear that you are populating the ValueList based on any row-specific information. So it seems like you could just populate a single ValueList and attach it to the whole column rather than creating a new one for cell.
I knew it was something that I was missing, and Yes, I did think that a row would be initialized just once!
I used the e.ReInitialize and it is working perfectly now. Even better and the valuelists are not being reloaded ever time I change a cell value now! Thanks for your help and keep up the great work.
Chip