FarPoint Forums

The FarPoint Message Boards
Welcome to FarPoint Forums Sign in | Join | Help
in Search

data binding custom object collection.

Last post 05-09-2008, 2:31 PM by parez81. 6 replies.
Sort Posts: Previous Next
  •  05-09-2008, 11:10 AM 63256

    data binding custom object collection.


    I have class A

    class
    {
    string ristname
    string lastname}
    }

    and collection List<A> someList;

    On my form i have a grid and some fields which represent A.
    I create object A and how do i add it to grid..
  •  05-09-2008, 11:31 AM 63259 in reply to 63256

    Re: data binding custom object collection.

    Spread does not support binding to a list that contains another class...

    http://www.clubfarpoint.com/Forums/forums/thread/60986.aspx

    Bob M.
    FarPoint Technologies, Inc.
  •  05-09-2008, 11:51 AM 63261 in reply to 63259

    Re: data binding custom object collection.

    The code below works only for one qualifier.. only the first time.. it shows one row in the gird..


            public ObservableCollection<Qualifier> Qualifiers { get; set; }

            private void ui_addQualifier_Click(object sender, EventArgs e)
            {
              

                Qualifier qualifier = GetQualifierFromForm();
     
                this.ConfirmationID = "Confirm";
                Qualifiers.Add(qualifier);
                ui_qualifierList.ActiveSheet.DataSource = this.Qualifiers;
                ui_qualifierList.Refresh();
                
            }
  •  05-09-2008, 11:55 AM 63262 in reply to 63261

    Re: data binding custom object collection.

    Yes, that is what happens when trying to do what you are doing.

    Bob M.
    FarPoint Technologies, Inc.
  •  05-09-2008, 12:31 PM 63266 in reply to 63262

    Re: data binding custom object collection.

    so should i use a strongly typed dataset instead of the list?
  •  05-09-2008, 12:33 PM 63268 in reply to 63266

    Re: data binding custom object collection.

    I would highly recommend that approach.

    Bob M.
    FarPoint Technologies, Inc.
  •  05-09-2008, 2:31 PM 63280 in reply to 63262

    Re: data binding custom object collection.

    Hi

    I managed to do what i was trying to by doing the following.



    Qualifier qualifier = GetQualifierFromForm();
     
                this.ConfirmationID = "Confirm";
                Qualifiers.Add(qualifier);

                ui_qualifierList.ActiveSheet.Models.Data = new FarPoint.Win.Spread.Model.DefaultSheetDataModel(this.Qualifiers, typeof(Qualifier));
View as RSS news feed in XML
     FarPoint Forums Home