Click here to Skip to main content
15,923,083 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi
Can you please provide me some resolution to make the cascading dropdowns work as expected when used inside edit mode of AspxGridview.
I am using DevExpress Controls.

My requirement is as follow:

If I select country="United States" then populate the "State" combobox and on selection of "State" populate the "City" combobox.

If I select "country" other then "United States" then populate only "City" combobox with cities of selected "country" and no need to populate the "State" combobox. Also I need to hide the "State" combobox.

i.e. like----------Country---------State--------City
---------ROW1------united states---Alaska-------Douglas
---------ROW2------Canada-----------------------Toronto
---------ROW3------Australia--------------------Sydeny
---------ROW4------united states---California---Yuba City


Same is required in Editmode also.
Please help me I need to do it ASAP.

Regards,
Pankaj.
Posted
Updated 15-Jul-11 16:14pm
v2

1 solution

VB
Protected Sub ddlCountry_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
      If ddlCountry.SelectedItem.Value = "US" Then
             ddlState.Visible = True
             txtState.Visible = False
             PopulateState();//Based on Country
      Else
             ddlState.Visible = False
             txtState.Visible = True
             PopulateCity();//Based on Country
      End If
End Sub


BTW Do changes based on your need.
 
Share this answer
 

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