StrataFrame Forum

TopMostItem with blank value and blank display

http://forum.strataframe.net/Topic5301.aspx

By Andria Jensen - 12/14/2006

I have a bunch of DevEx inherited combos which I am binding to a BO.  I would like to be able to clear each of these out by selecting a blank value from the dropdown or by pressing delete on the combo.  I have done this before by using TopMostItem and setting the value to "" and the display to "(none)" or something like that.  In these cases I would like for the display to just be an empty string, but the value also needs to be an empty string.  When both of these are empty it does not put a TopMostItem in the combo and assumes you don't want one.  Is there a way to "trick" it into letting me do this or another way to accomplish it?  I tried putting in " " as a space instead of "" so it would look blank, but this didn't work either.  Any suggestions?  Thanks!
By Trent L. Taylor - 12/14/2006

When both are empty the TopMostItem assumes that it will not be used.  It all depends on how you are populating your combos.  Ultimately these are just DataTables which are associated with the DataSource of the combo.  So you could manually add a row to the DataTable.

With CType(MyCombo.DataSource, DataTable)
  '-- Add a row to the data source or create a new data source
EndWith