Hi all,
I was wondering if what I'm attempting to do is possible. I've read the forums and knowledge-base article KB07841(HOWTO:What is the best way to place a DropDown list in a grid cell?), but I think my situation is slightly different.
In my scenario, the gird is already populated with data, and when a user clicks a certain button, I want to fill one of the row's cell with a drop-down containing some new data.
When I follow the steps shown in the knowledge-base article, I notice that its making use of the Grid InitializeLayout event. Does this still apply if my grid has already been data-bound, and I'm only adding new data to one cell of one row? I ask because when I try adding either ValueListItems or an UltraDropDown into the cell, outside of the InitializeLayout event, neither shows up.
I'm using v10.3 of the software.
Thanks,
Ben Z
Hi Ben,
It's not clear to me what you are trying to do exactly.
bzarboni said:In my scenario, the gird is already populated with data, and when a user clicks a certain button, I want to fill one of the row's cell with a drop-down containing some new data.
Where is this button? Are you talking about a button in a cell/row of the grid? Or is this some external button.
Populating a ValueList and attaching it to a column or cell can be done at any time, but attached a ValueList to a column doesn't change the Value of any of the cells in that column. And the list does not appear until you click on the dropdown arrow to drop it down.
So it's not clear to me what you mean by "neither shows up." Are you saying you don't see the dropdown arrow in the cell? Or are you expecting something to display in the cell simply because you added a ValueList to the cell or column?
If you are attaching a ValueList to a column in the grid and you are not seeing the dropdown arrow in that column, then it's most likely because the field is not editable.
Hi Mike,
Thanks for getting back to me. Your advice did solve the issue, but I'll clarify my post just in case anyone else runs into the same problem.
The button I have in my form is outside of the grid. Essentially, the grid has been populated with data, and if/when the user clicks this external button, the code loops through each grid row, finds an ID value, and then goes back to the database to fill in an extra (previously-empty) cell.
I am filling in the empty cell on each row, and not changing the entire column. I'm doing this because in some cases there are 0 or 1 values retrieved from the database (no drop-down required), but in other cases 2 or more values are fetched. These are the instances where I want to create a drop-down in the grid cell.
When I said "neither shows up" earlier, I was referring to the fact that in the KB article, there are two methods listed to add a drop-down to a cell / column - One is to add a ValueList, the other is to add an UltraDropDown. I've tried both ways, and neither seems to work for me. I don't see an arrow, or any values in the cell.
I did find that the field was not editable, so I enabled editing on the grid, and that solved the issue.