How to control user input to a Net Grid cell with value list?

Hi,

Anyone knows how we can control the user input to a Net Grid cell with value list?

I have a value list set to a cell where user can select option from the drop-down list. But it is still possible to enter any value into that cell, which is what I don't want (see snapshot below)

I know that the entered value will not be accepted if it is not the same as what I have in the value list, but I just don't want the users to get confused that they can enter value into the cell instead of selecting from the value list.

So I just want to know whether we can disable the manual input, or we have a way to check the input value against the value list. I can check that if I know which value list is set to the cell (I have different value lists set to different cells), but I can't find any method in the Net Grid API which helps to get that.

Any advice would be appreciated.

Regards,

Anh

  • Hi, you can use BeforeCellUpdate event.

    For example:

    !this.gridParams.AddEventHandler('BeforeCellUpdate', !this, 'OnBeforeCellUpdate')
    
    
    define method .OnBeforeCellUpdate(!args is ARRAY)
        --Array[0] is the new value the cell is to be updated to
        --Array[1] is the row index of the cell
        --Array[2] is the column key of the cell
        --Array[3] is the band/datatable name
        --Array[4] is a true flag, used for other pml variables to signify a change is about to occur
        --Array[5] is an empty string, normally used for storing old values about to be changed
    endmethod

  • Hi,

    Yes, I know this. But my question is how to know which value list is set to which cell (I have different value lists set to different cells). I used a workaround to do that, but just wonder if there is any Net method which can quickly get the value list set to the cell.

    /Anh

  • It seems that there are no method to get list of values of cell. It seems like you need to link some arrays with some cells and with BeforeCellUpdate event get index of cell and compare with array