locked
The age old Selecting Event not firing RRS feed

  • Question

  • User-1581908294 posted

    I have 3 combo boxes whose datasourceID is a sqldatasource.

    cmbCampus (list of all University and Colleges who have organizations that are our customers)

    cmbOrg (list of all Organizations on a particular campus who are our customers) Content depends on selected value of cmbCampus

    cmbClass (list of the class structure used by a particular organization (eg. Freshman, Sophomore, etc.). Content should depend on selected value of cmbOrg

    cmbCampus and cmbOrg are in perfect synch every time.  When view state is enable on cmbOrg, the selecting event randomally does not fire.  It is too random to see a pattern.  When view state is disabled, the selecting event fires every time but the content in cmbClass is the previously selected Organization's class structure not the current selected Organization (as I would expect).

    databind is performed for all 3 combo boxes in page load.  It is puzzling that cmbCampus and cmbOrg are basically databind once and forget.  Where as cmbClass has a problem somewhere.

    cmbClass is configured:

    DatasourceID: sqldsClass (which has a parameter set to selected value of cmbOrg.  This parameter is OrgID and is PK of the Organization table)

    DataTextField: CompClass

    DataValueField CompClass

    What little pattern I can detect is this problem occurs most often (but not every time) when switching campuses.  Although the cmbOrg updates correctly and cmbOrg.SelectedValue changes, the cmbClass does not update (selecting event also does not fire for sqldsClass).

    However, selecting different organizations within the dropdown works everytime (cmbClass shows the correct listing of classes and sqldsClass' selecting event fires).  Even when switching Campus and cmbOrg updates correctly but cmbClass fails for the first Organization in cmbOrg's dropdown list, simply selecting another organization in the dropdown and reselecting the first one works.

    I appreciate the help and let me know if I need to post more information.

    Monday, August 12, 2013 3:39 PM

Answers

  • User-1716253493 posted

    If you have more than 2 combo/dropdown (cascading), use multiple select parameters

    Use cmbOrg as selectparameter of cmbCampus SqlDataSource

    Use cmbCampus and cmbOrg as selectparameters of cmbClass

    So, when you make selection cmbOrg will also refress cmbClass

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 12, 2013 9:07 PM

All replies

  • User-1716253493 posted

    If you have more than 2 combo/dropdown (cascading), use multiple select parameters

    Use cmbOrg as selectparameter of cmbCampus SqlDataSource

    Use cmbCampus and cmbOrg as selectparameters of cmbClass

    So, when you make selection cmbOrg will also refress cmbClass

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 12, 2013 9:07 PM
  • User-1581908294 posted

    The underlying store procedure which selects the schema only has a single parameter @OrgID.  Fortunately all I had to do was add @CampusID and set its default to 0 since it is not require in the select statement.  Then I could set the select parameters OrgID and CampusID to cmbOrg and cmbCampus respectively in sqldsClass.

    Re: "Use cmbOrg as selectparameter of cmbCampus SqlDataSource"  Since Campus is the parent of Org this would not work.  I think this is just a misunderstanding.

    Thank you for the help.

    Tuesday, August 13, 2013 11:45 AM