Please HELP!!

 
Hi,
 
We have made our collections bindable at design time..by implementing IComponent..
One of my form has CustomerCollection(variable is CustomerCollection1),and textboxes are binded to its properties at designtime..We are having a global function which loads customercollection..when user gets logged in..called..global_CustCollection..Now, on form load of customer I am assigning this global collection to, collection object binded to form at design time(CustomerCollection1)..but when I view the form no data is being displayed though the collection object(CustomerCollection1) has the data..
why is it so
thks



Answer this question

Please HELP!!

  • Neil Watson

    Yes,collection are having items..when i am getting data directly from database it shows..when I am getting data into a global collection..and then assign it to form level collection it does not display data..
    thks

  • zmrcic

    Hi,

    did you bind the collection to the Text property of your Textbox. Is your Collection filled with items Why do you not bind a array or arraylist to the textbox

  • MNMamun

    If I understand this right, what you are seeing is expected. When you set your globalCollection to customerCollection1, you are basically creating a new Collection i.e. it is as good as doing: custmerCollection1 = new CustomerCollection();. When you create a new collection there is no way fior the binding to know that a new collection is created and the bindings will not work.

    For this to work, you can use the new BindingSource component. Do the following:
    BindingSource.DataSource = customerCollection1;
    Bind the textBoxes to this BindingSource.

    Finally, when you have a new GlobalCollection, simply set it as the DataSource of the BindingSource. The TextBox bindings will be preserved.

    Thanks,
    -Dinesh Chandnani


  • Please HELP!!