Hi,
I need a way to make it so choosing an option in a dropdown list does not change the value in the cell, but instead starts running another command in my application that will cause the cell value to update.
I already have the code for updating the cell value when the other part of my application causes it to change.
The cell's column style is set to ColumnStyle.DropDown, and AutoEdit is false so it does not pull values from the dropdown list if the user types in the cell. I have a valuelist set up and attached to the column. I am not using any embedded editors (the column.editor property = nothing)
I'm using the CellListSelect event to determine what value was chosen, and I am able to start running the other commands in my app based on that.
The problem is, when I choose a value from the valuelist, it gives the cell that value. I need to stop it from changing the cell's value with the option chosen from the valuelist, and I can't figure out how to do that.
Thanks for the help,
~Karen
Thanks Mike - That's what I've ended up doing. I appreciate the help.
Hi Karen,
Okay, I see. I think using a ValueList is the wrong way to go, then. A ValueList is always gong to try to update the value of the cell and you will have a hard time fighting that functionality.
What I would do is set the Style on the column to EditButton. Then you can trap the CellButtonClick event of the grid and show a context menu.
Mike,
The Grid that I am creating is to be used on a tablet PC, and we are trying to avoid the user having to right-click to get to functionality. We wanted a more in-your-face list of choices. We need a way of having a button in a cell, so that clicking on the button will open the list of choices for the cell (like a menu).
The choices in the dropdown list will need to cause different actions depending on what they are. In some cases, the chosen valuelist item should be concatenated with the value displayed in the cell currently. In other cases, choosing an item would cause a popup window to open for editing the text in a cell, and then that new text would be saved to the cell when the popup is closed. In another case, choosing a valuelist item would start some other action in the program, which will eventually cause the cell to update.
If I can't do what I need to with the dropdown lists, I think another option for me will be to put a dropdown button in a cell, and then make it so clicking the dropdown button opens a popup menu under the cell. If I take this route, How can I display a dropdown button in the cell?
Thanks,
If you want the dropdown to act like a context menu, then why use a dropdown? Why not use a context menu?
I've run into another problem with this - The CellListSelect event does not fire if I choose the same option as the previous time I selected a value in the list. So it's not working to choose the same option twice. Ideas??
Thanks,~Karen