public
class ReportRequest
{
public int ReportID { get; set; }
public string ReportName { get; set; }
public int Days { get; set; }
public ReportRequest(int reportID, string reportName, int days)
{
this.ReportID = reportID;
this.ReportName = reportName;
this.Days = days;
}
}
and I want to load a collection of these objects into a combo box like this:
List<ReportRequest> reports = new List<ReportRequest>();
reports.Add(
new ReportRequest(1, "Report 1", 10));
reports.Add(
new ReportRequest(2, "Report 2", 20));
reports.Add(
new ReportRequest(3, "Report 3", 30));
reports.Add(
new ReportRequest(4, "Report 4", 40));
RadComboBox1.DataValueField =
"ReportID";
RadComboBox1.DataTextField =
"ReportName";
RadComboBox1.DataSource = reports;
RadComboBox1.DataBind();
I only want the report name to show but when a user makes a selection I'd like to get the Days property as well. Its not truly a multi-column combo box as only 1 column will show to the user. I also can't seen to add anything other than a RadComboBoxItem to the Items collection of the combo box.
How can I accomplish this?
Thanks
Carl