Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
960
dropdownlist default value in addrow
posted

I have a grid which allows adding new rows via a dropdownlist column.

this column's valuelist is a lookup of objects from db with autonumber ids, so id and text value is shown.

the column in db does not allow nulls.

in the addrow, when trying to add a new row in the grid, when clicking on the dropdown, it defaults to 0.

I'm guessing this is because it is bound to a non nullable datatype and it defaults to 0 since the valuelist values start at 1.

Is there any way to change that?  hide it?

Parents
  • 469350
    Offline posted

    Hi,

    I'm not sure I understand exactly what's going on, but it sounds like the 0 is coming from the data source and not the grid.

    There are a couple of ways you could handle this. One would be to add a null item to your dropdown list with a key value of 0 and an empty string as the text.

    Another would be to use a DataFilter to translate the "0" into an empty string (and vice versa) in the EditorToDisplay and DisplayToEditor conversions.

Reply Children