0
votes

My dropdownlist is set to databine like this...

dt = dal.FillDataTable(SqlConnectionString, "SELECT SQL Query Statement")
dropdownlist1.datasource = dt
dropdownlist1.datatextfield = dt.columns.item(0).tostring
dropdownlist1.databind()

This is turn populates my dropdownlist, when a user selects a value, it is then populated to the remaining textboxes on the remaining forms with a session call...

dropdownlist2.add(ctype(session.item("valOne"), String))

Through this session it populates the one value, is it possible to display the selected value but also include all other dropdownlist items in case they want to change thier selection? Any suggestions would really help?

1

1 Answers

0
votes

I didnt understand adding one value at a time. Just show them all the associated values and let them select or change their decision.

Sample code

public DataSet GetmTest_Filter()
    {

        try
        {
            DataSet oDS = new DataSet();

            SqlParameter[] oParam = new SqlParameter[1];

            oParam[0] = new SqlParameter("@col_Id", _scolidvalue);

            oDS = SqlHelper.ExecuteDataset(DataConnectionString, CommandType.StoredProcedure, "your_stored_procedure_here", oParam);
            return oDS;
        }
        catch (Exception e)
        {
            ErrorMessage = e.Message;
            return null;
        }
    }
    public void ddlFill_Test(DropDownList ddl)
    {
        DataSet oDSddlmTest = new DataSet();
        oDSddlmTest = GetmTest_Filter();
        if (oDSddlmTest.Tables[0].Rows.Count > 0)
        {
            ddl.DataSource = oDSddlmTest.Tables[0].DefaultView;
            ddl.DataTextField = "col_desc";
            ddl.DataValueField = "col_id";
            ddl.DataBind();
        }
        else
        {
            ddl.Enabled = false;
        }
    }

May this help you.