c# - Problems with BindlingList<T> and combo box -


i have got following code:

private bindinglist<inoun> _nouns;  private bindinglist<inoun> nouns {         {         if ( _nouns == null )         {             _nouns = new bindinglist<inoun>( _model.feature.nouns );             _nouns.insert( 0, new noun( -1, "please select..." ) );         }         return _nouns;     } }   public interface inoun {     int id;     string text; } 

the nouns property bound combobox adds default entry please select... bindinglist.

the issue having here please select... entry unexpectedly being added underlying_model.feature.nouns collection , not want happen.

is there anyway can add please select... default item combobox without being added underlying collection?

thanks

bindinglist wrapper, notifications, around _model.feature.nouns remains underlying list of items (that's why have allowedit, allownew, allowremove on bindinglist) :

if want work on brand new list (though i'm not sure it's purpose of bindinglist), try :

_nouns = new bindinglist<inoun>( _model.feature.nouns.select(x=>x).tolist()); 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -