0

I have a requirement to create dynamic fields for form. Searched online and here and found this design guideline while it miss some of my requirements. I don't need exact code but general guideline.

User will have DropDownList with Properties he can add. Each Property divided into two parts. First part is for User to use for SearchCombination ( combination of Properties) and other part is for Customer to use.

ie. User chooses Age in DropDownList, this should produce AgeFrom/AgeTo DropdownLists on SearchCombination page and Day/Month/Year DropDownLists on Customer page.

How can i tackle this problem? Again i need only guideline and no real code unless you want to so please no suggestions "What have you tried", this is design question.

The only solution i see it to follow solution above while SearchCombination and Costumer control groups will be UserControls at the same table

Thanks

Community
  • 1
  • 1
eugeneK
  • 10,750
  • 19
  • 66
  • 101

1 Answers1

0

Here is a tiny simple version, hope this guides you in the right direction

  if(DropDownList.SelectedValue == "age")
    {
       DropDownList listFromAge = new DropDownList();
       listFromAge.DataSource = myAgeDataSource;
       Controls.Add(listFromAge);

       DropDownList listToAge = new DropDownList();
       listToAge.DataSource = myAgeDataSource;
       Controls.Add(listToAge);

    }
JohnnBlade
  • 4,261
  • 1
  • 21
  • 22
  • Thanks for the answer but i'm looking for more maintainable solution than having 20 IFs over each page i need this. – eugeneK Jul 04 '12 at 11:06