ListObject binding

is it possible to bind a listobject to a collection in C# I appreciate if anyone has an example.

Thanks



Answer this question

ListObject binding

  • yatingg

    thanks... what about the order of columns displayed. I have bound the listobject to a Person class having firstname lastname and age properties. the listobject is showing the lastname first and then firstname. how is it basing its order
  • Fredrik Kronander

    listObject.SetDataBinding(dataSource, dataMember, string[] columns)
    show only and order of columns


  • DQM

    this is fine when we are dealing with data tables in datasets. but in my case i have a Person class and a collection of Persons. the datasource is the collection but what is the datamember and the column names in that case
  • atypoli

    what kind of collection you want to use

    view this, from msdn (data source for listobject):

    The following data sources are valid:

    See the Binding class overview for more information on data sources.




  • finialscraps

    datamember = "" worked....

    Thanks


  • prujohn

    try with datamember "" and new string[]{firstName, lastName}etc
    maybe work


  • ListObject binding