Checked List box - datavaluefield

Discussion in 'ASP .Net Web Controls' started by Richard Roche, Dec 2, 2003.

  1. How can i set the checked/not checked value of a
    checklistbox from a dataset/datareader?

    I tried assigning the 'datavaluefield' but the checked
    values are never set. I'm using a bit field in sql server.

    thanks.
     
    Richard Roche, Dec 2, 2003
    #1
    1. Advertising

  2. Richard Roche

    MSFT Guest

    Hi Richard,

    Checklistbox doesn't support bindind to its checkbox value. I think you may
    use a repeater control instead. For exmaple:

    <asp:Repeater id="Repeater1" runat="server" DataSource="<%# DataSet21 %>"
    DataMember="Table6">

    <itemtemplate>
    <asp:CheckBox Runat =server Checked =<%#
    DataBinder.Eval(Container.DataItem, "check") %> ></asp:CheckBox>

    <%# DataBinder.Eval(Container.DataItem, "name") %><br>
    </itemtemplate>


    </asp:Repeater>


    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    MSFT, Dec 3, 2003
    #2
    1. Advertising

  3. Thank you, i appreciate it.
     
    Richard Roche, Dec 3, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Parodi Development
    Replies:
    0
    Views:
    3,667
    Parodi Development
    Sep 10, 2004
  2. =?Utf-8?B?UkY=?=

    Concatenating Multiple Values for DataValueField

    =?Utf-8?B?UkY=?=, Dec 2, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    7,382
    Marina
    Dec 3, 2004
  3. yurps
    Replies:
    1
    Views:
    6,901
    rajeshthangarasu1983
    Feb 29, 2008
  4. =?Utf-8?B?U3VuaWwgU2FiaXI=?=

    Advantage of DataValueField

    =?Utf-8?B?U3VuaWwgU2FiaXI=?=, Feb 1, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    3,560
    Eliyahu Goldin
    Feb 1, 2005
  5. Sam
    Replies:
    1
    Views:
    12,086
    Eliyahu Goldin
    Feb 18, 2005
Loading...

Share This Page