HowTo Bind a New Collection to my DataGrid? Please take a look to my little code...Thanks!!

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default HowTo Bind a New Collection to my DataGrid? Please take a look to my little code...Thanks!!

    Hello,
    I have this

    Public Structure strucUser
    Dim userIDAs Integer
    Dim firstnameAs String
    Dim lastname As String
    End Structure

    Dim collectUser As New Collection
    Dim strucUser As strucUser
    strucUser .userIDAs = rateID
    strucUser .firstnameAs = "Peter"
    strucUser .lastname = "Bond"
    collectUser .Add(strucUser )

    myDatagrid.DataSource = collectRate <<<---- ERROR !!!
    myDatagrid.DataBind()


    Error Message:
    DataGrid with id '' could not automatically generate any columns from the
    selected data source

    What is wrong?

    Thanks for any help,
    Andreas


    Andreas Klemt Guest

  2. Similar Questions and Discussions

    1. Howto bind CheckBox to the datagrid/ Then update the database field when the checkbox is clicked.
      I am trying to update the database field when the checkbox is clicked. I am trying to modified the following solution but.. got stuck on the...
    2. custom usercontrol inside of datagrid - loses its state/viewstate on re-bind/postback of the datagrid
      I have a simple usercontrol, a datepicker which contains 3 dropdownlist , it resides inside a datagrid column and i set the selecteddate property of...
    3. How do I dynamically bind a textbox into a grid field in ASP.NET using only the code behind?
      I am trying to take dynamically generated datagrid that is bound to a data source and make one of the fields on the grid into an editable textbox...
    4. Bind the DataGrid..?
      Hi all, How can I get data to show in a datagrid? This is what I have tested: =============================== Dim ConnStr As String ConnStr =...
    5. HowTo export the VisualStudio Project Code to HTML Viewable like IBUYPORTAL
      Hello, can I export my code in VisualStudio to HTML like IBUYPORTAL? Thanks, Andreas
  3. #2

    Default Re: HowTo Bind a New Collection to my DataGrid? Please take a look to my little code...Thanks!!

    Hi,

    1) where collectRate come from ?
    2)

    Natty Gur, CTO
    Dao2Com Ltd.
    28th Baruch Hirsch st. Bnei-Brak
    Israel , 51114

    Phone Numbers:
    Office: +972-(0)3-5786668
    Fax: +972-(0)3-5703475
    Mobile: +972-(0)58-888377

    Know the overall picture


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Natty Gur Guest

  4. #3

    Default Re: HowTo Bind a New Collection to my DataGrid? Please take a look to my little code...Thanks!!

    Hello Natty,

    sorry, this was collectUser
    But it still doesn't work.
    Can you help me?

    Andreas

    "Natty Gur" <natty@dao2com.com> schrieb im Newsbeitrag
    news:uf9xu3hSDHA.1948@TK2MSFTNGP12.phx.gbl...
    > Hi,
    >
    > 1) where collectRate come from ?
    > 2)
    >
    > Natty Gur, CTO
    > Dao2Com Ltd.
    > 28th Baruch Hirsch st. Bnei-Brak
    > Israel , 51114
    >
    > Phone Numbers:
    > Office: +972-(0)3-5786668
    > Fax: +972-(0)3-5703475
    > Mobile: +972-(0)58-888377
    >
    > Know the overall picture
    >
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Andreas Klemt Guest

  5. #4

    Default Re: HowTo Bind a New Collection to my DataGrid? Please take a look to my little code...Thanks!!

    OK,

    "Use the DataSource property to specify the source of values to bind to
    a data listing control. The data source must be an object that
    implements the System.Collections.IEnumerable interface (such as
    System.Data.DataView, System.Collections.ArrayList, and
    System.Collections.Hashtable) to bind to a control derived from the
    BaseDataList class." - MSDN

    VB collection dosent Implement one of them. consider using one of the
    system.collection classes.



    Natty Gur, CTO
    Dao2Com Ltd.
    28th Baruch Hirsch st. Bnei-Brak
    Israel , 51114

    Phone Numbers:
    Office: +972-(0)3-5786668
    Fax: +972-(0)3-5703475
    Mobile: +972-(0)58-888377

    Know the overall picture


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Natty Gur Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139