Click here to Skip to main content
15,888,802 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a class and i have created the method

XML
public List<SycDepositType> GetAll()
      {
          List<SycDepositType> sycDepositType = null;
          try
          {
              sycDepositType = (DcSystemConfiguration.GetTable<SycDepositType>()).ToList<SycDepositType>();
          }
          catch (Exception ex)
          {
              ErrorWriter.WriteError(ex, "FunctionName --> GetDataTable", RequestPage);
          }
          return sycDepositType;
      }


and i have to show the items on dropdown ddlInterestTransfer the items on selecting the items on ddlDepositType.


C#
protected void ddlDepositType_SelectedIndexChanged(object sender, EventArgs e)
    {
        //msg = new Message("", GlobalEnum.MessageStatus.Alert, GlobalEnum.MessageCss.Alert);
        //ConfirmationMessage1.SetMessage(msg);
        ConfirmationMessage1.EnableViewState = false;
        int s = Convert.ToInt32(ddlDepositType.SelectedValue);
        cSycDepositType = new CSycDepositType(HttpContext.Current.Request.RawUrl);
        var sycDepositType = cSycDepositType.GetBySycDepositTypeId(s);

                //Normal savings

        if(sycDepositType.SycDepositCategoryId == 1)
        {
            ddlInterestTransfer.Visible = false;
        }

                //Recurring savings

        else  if (sycDepositType.SycDepositCategoryId == 2)
        {
            ddlInterestTransfer.Visible = false;
        }
                 //fixed savings

        else if (sycDepositType.SycDepositCategoryId == 3)
        {
             ddlInterestTransfer.Visible = true;
             ddlInterestTransfer.DataSource = null;
            if ( sycDepositType.SycInterestCalculationPeriodId == 5)
            {

                cSycInterestCalculationType = new CSycInterestCalculationType(HttpContext.Current.Request.RawUrl);
                var sycInterestCalculationType = cSycInterestCalculationType.GetAll();
                ddlInterestTransfer.DataSource = sycInterestCalculationType;
                ddlInterestTransfer.DataTextField = sycInterestCalculationType;
                //ddlInterestTransfer.DataValueField = sycInterestCalculationType.ToList();
                //ddlInterestTransfer.DataBind();
            }
            else
            {
                cMamAccountOpeningDepositType = new CMamAccountOpening(HttpContext.Current.Request.RawUrl);
                var mamAccountOpeningDepositType = cMamAccountOpeningDepositType.GetAll();

            }


        }


    }



if if ( sycDepositType.SycInterestCalculationPeriodId == 5) then i have to show all items on ddlInterestTransfer with getall as done on shown code .

so how to show the items on dropdown from code.
Posted
Comments
tanweer 7-Oct-13 2:18am    
are you facing any issue, is there any error in your current code? Please explain little more

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900