Professional Web Applications Themes

.NET databound radiolistbutton in a repeater - Dreamweaver AppDev

I have a databound radiobuttonlist in a repeater and I am at a loss to figure out how to set a selected item at runtime? Any help would be appreciated. Rod...

  1. #1

    Default .NET databound radiolistbutton in a repeater

    I have a databound radiobuttonlist in a repeater and I am at a loss to
    figure out how to set a selected item at runtime? Any help would be
    appreciated.
    Rod


    Rod Snyder Guest

  2. #2

    Default Re: .NET databound radiolistbutton in a repeater

    In your repeater column, call a custom routine which returns a routine.. My
    routine returns a list of employees assigned to a project. The important point
    is that you can reverse engineer the needed html in your called procedure and
    return it as a string this goes in the repeater object in place of where you
    would usually have a <%# DataSet1.FieldValue('myfield', Container) %> <%#
    GetAssignees((System.Data.DataRowView) Container.DataItem) %> the function
    (which I did in a code behind page but which could be in the page itself is
    public string GetAssignees(System.Data.DataRowView thedata) { System.Int64
    theid=(System.Int64)thedata['id']; assigneelist=new
    swimsql.baseLookTable();;
    assigneelist.set_ConnectString(ConfigurationSettin gs.AppSettings['ufportal_co
    nn_nonoledb']); assigneelist.Load_LookUpData('select username from
    projectrequest_assignees a right join application_users u on a.user_id=u.id
    where a.proj_id='+theid.ToString(), 'assignees');
    System.Data.DataRowCollection
    theassigneerows=assigneelist.dsLookUp.Tables['assignees'].Rows; if
    (theassigneerows.Count==0) { return 'No one'; } else { // build list of
    assigned employees string thelist=''; int rowcount=0; foreach
    (DataRow row in theassigneerows) { rowcount++; if (rowcount>1)
    thelist+='<br>'; thelist+=row['username']; } return
    thelist; } } I did use a custom framework in the routine in my codebehind
    page to access the data but again.. all that matters is that the string you
    return creates the raw radio button html (with the appropriate value selected).
    Hope this helps Rich McCrea

    RichMcCrea Guest

  3. #3

    Default Re: .NET databound radiolistbutton in a repeater

    sorry about the formatting problems in the previous message.. I made a type and
    when I re-edited the text.. the forum put all those <BR> tags in.. copy my
    answer out and replace all the <BR> tags with (CR+LF) characters and it will be
    readable again.. lol.. sorry.

    RichMcCrea Guest

  4. #4

    Default Re: .NET databound radiolistbutton in a repeater

    if it is impossible to understand this.. send me an email and I will send you the source code in it's entirety (richmccrearichmccrea.com)
    RichMcCrea Guest

Similar Threads

  1. UserControl with databound repeater drops values on postback
    By paul.hester@gmail.com in forum ASP.NET Building Controls
    Replies: 3
    Last Post: September 2nd, 07:11 AM
  2. UserControls and DataBound Repeater
    By Alex Maghen in forum ASP.NET Building Controls
    Replies: 2
    Last Post: June 15th, 01:08 PM
  3. Replies: 1
    Last Post: April 8th, 11:23 PM
  4. xml & databound (sorting & top 5)
    By Eph0nk in forum ASP.NET General
    Replies: 0
    Last Post: July 29th, 01:56 PM
  5. DataBound ListBox
    By anastasia in forum ASP.NET General
    Replies: 5
    Last Post: July 5th, 04: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