I have the following class definition
public class MyClass
{
    public MyClass(String myMember)
    {
        this.MyMember = myMember;
    }
        public String MyMember
    {
        get;
        set;
    }
}

And in code behind I am creating a dictionary to a radio button.

        Dictionary<int, MyClass> dc = new Dictionary<int, MyClass>();
        dc.Add(1,new MyClass("xxx"));
        dc.Add(2,new MyClass("yyyy"));

        RadioButtonList2.DataSource = dc;
        RadioButtonList2.DataTextField = "value";
        RadioButtonList2.DataValueField = "key";
        RadioButtonList2.DataBind();
But the page shows radiobuttonlist with only "MyClass". How can I make
the the values "xxx", "yyy" to appear in the radio button list
I found that with an ArrayList I can specify the following
RadioButtonList1.DataTextField = "MyMember"; But this is not working
with Dictionary

-- 
You received this message because you are subscribed to the Google
Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
Web Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
or visit the group website at http://megasolutions.net

Reply via email to