Get RadioButton value from Nested Repeatr

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Christiano Donke

    Get RadioButton value from Nested Repeatr

    Hy there,

    pla.. i have 2 nested repeaters. In the child i have 3 radiobuttons.


    Already made my homework and figured out how to allow only one radio to be
    checked....

    but now, i can't find out which radio is selected.

    the submit (asp:Button) button is placed inside the ParentRepeater
    FooterTemplate.


    tks in advance,
    christiano


  • =?Utf-8?B?YnJ1Y2UgYmFya2Vy?=

    #2
    RE: Get RadioButton value from Nested Repeatr

    simple, just do a recursive walk:

    //get list of all selected Radio buttons

    var list = FindControls(Pa ge, c=c is RadioButton && ((RadioButton)
    c).Checked);

    public static List<ControlFin dControls(
    Control parent,
    Predicate<Contr olmatch)
    {
    var list = new List<Control>() ;
    foreach (Control ctl in parent.Controls )
    {
    if (match(ctl))
    list.Add(ctl);
    list.AddRange(F indControls(ctl , match));
    }
    return list;
    }


    -- bruce (sqlwork.com)


    "Christiano Donke" wrote:
    Hy there,
    >
    pla.. i have 2 nested repeaters. In the child i have 3 radiobuttons.
    >
    >
    Already made my homework and figured out how to allow only one radio to be
    checked....
    >
    but now, i can't find out which radio is selected.
    >
    the submit (asp:Button) button is placed inside the ParentRepeater
    FooterTemplate.
    >
    >
    tks in advance,
    christiano
    >
    >
    >

    Comment

    Working...