Professional Web Applications Themes

Binding RadioButtonList ... - ASP.NET General

Hi! I wonder if thats a bug or something: I have an object which has arrayList of child objects exposed to clients. This child object also exposed to clients. Class A { public ArrayList CurrentList = new ArrayList(); } Class B { int _DetlKey; string _Detl; public int DetlKey { get { return this._DetlKey; } set { _DetlKey = value; } } public string Detl { get { return this._Detl; } set { _Detl = value; } } } //code to populate array list omitted. Then I use this code to bind my List: rbList.DataSource = A.CurrentList; rbList.DataBind(); And I ...

  1. #1

    Default Binding RadioButtonList ...

    Hi!

    I wonder if thats a bug or something:

    I have an object which has arrayList of child objects exposed to clients.
    This child object also exposed to clients.

    Class A
    {
    public ArrayList CurrentList = new ArrayList();
    }

    Class B
    {
    int _DetlKey;
    string _Detl;

    public int DetlKey
    {
    get
    {
    return this._DetlKey;
    }
    set
    {
    _DetlKey = value;
    }
    }

    public string Detl
    {
    get
    {
    return this._Detl;
    }
    set
    {
    _Detl = value;
    }
    }
    }


    //code to populate array list omitted.


    Then I use this code to bind my List:

    rbList.DataSource = A.CurrentList;
    rbList.DataBind();

    And I get error:

    Exception Details: System.Web.HttpException: DataBinder.Eval:
    'ASPNetPortal.B' does not contain a property with the name DetlLey.

    What is the problem here?

    I searched NG and came up with posts saying that properties have to be
    actual properties in classes, not fields. I changed class (it's in example)
    but steel get error.


    Any ideas?




    Ivan Guest

  2. #2

    Default Re: Binding RadioButtonList ...

    While there are plenty of bugs in software as big as ASP.NET, it's best to
    assume that the bug is in your code until you have conclusively proven
    otherwise.

    In this case, you are throwing the error in your DataBinder.Eval call, which
    you don't show. I would step through your code to find the exact line, and
    then post what you are doing in the Eval statement to give us a feel for
    what you are doing when the error occurs. There is nothing to indicate that
    you are having a problem with the binding, at least that I can see.

    --
    Chris Jackson
    Software Engineer
    Microsoft MVP - Windows XP
    Windows XP Associate Expert
    --

    "Ivan Demkovitch" <id> wrote in message
    news:phx.gbl... 



    Chris Guest

  3. #3

    Default Re: Binding RadioButtonList ...

    Chris,

    Thanks for answering. Did you personally bind radiobuttonlist to ArrayList?

    I'm using WebMatrix and cannot step thru code. But error is on
    rbList.DataBind(); call

    there is no call for DataBinder.Eval in my code.

    Here is a link on a same problem in another post. Solution provided does not
    work for me.
    http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=e41d01c28a43%249f9eedb0%242ae2c90a%40phx .gbl&rnum=2&prev=/groups%3Fq%3Dbind%2Bradiobuttonlist%2Barraylist%26 ie%3DUTF-8%26oe%3DUTF-8%26hl%3Den%26btnG%3DGoogle%2BSearch

    Thanks,
    Ivan

    "Chris Jackson" <org> wrote in message
    news:%phx.gbl... 
    which 
    that [/ref]
    clients. [/ref]
    example 
    >
    >[/ref]


    Ivan Guest

Similar Threads

  1. Problem: Binding a datatable to RadioButtonList inside a DataGrid
    By Andy in forum ASP.NET Building Controls
    Replies: 0
    Last Post: March 6th, 11:56 PM
  2. Replies: 0
    Last Post: June 1st, 04:01 PM
  3. RadioButtonList
    By anonymous in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: May 10th, 05:26 PM
  4. Radiobuttonlist and cssclass
    By Nick Hartley in forum ASP.NET Building Controls
    Replies: 2
    Last Post: July 6th, 04:50 PM
  5. radiobuttonlist and javascript??
    By Leif in forum ASP.NET General
    Replies: 1
    Last Post: July 11th, 06:58 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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