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
580
ValueList select blank value
posted

I am using a WinGrid with ValueLists as dropdowns. I have a grid with multiple rows. I would like to clear a selected value form some cells and set them to blank so user can reselect new values. I have tried:  row.Cells[0].Value = ""; but I am getting can’t convert string to int error. I would like a cell to be in inital state when grid was loaded for the firts time – no selection(blank)

If I remember correctly I coundn’t create a blank valueListItem as it was by default setting description to value and I can’t dispaly that.

Parents
  • 469350
    Verified Answer
    Offline posted

    Hi,

    What kind of DataSource are you using for your grid?

    If the field in the grid is an int (as it appears from the error message), then you cannot assign it an empty string. This is not related to the grid, it's the data source that limits you.

    If you are using a DataTable or DataSet, then it will handle null values for you and the thing to do is set the Value of the cell to DBNull.Value.

Reply Children
No Data