View Single Post
  #17 (permalink)  
Old August 29th, 2012, 04:47 AM
rmanapul rmanapul is offline
Authorized User
Points: 109, Level: 2
Points: 109, Level: 2 Points: 109, Level: 2 Points: 109, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2012
Posts: 29
Thanks: 11
Thanked 0 Times in 0 Posts
Default

for example,

using values to change the contents of gridview. i can do it without the help of datasource control

Code:
If Province_Ddl.SelectedValue = "Province1" Then
                Dim Province1Municipality = From city In myEntities.CityTbls
                                        Where city.Province = "Province1"
                                        Order By city.City
                                        Select city.City

                cityGridView.DataSource = Province1Municipality
                cityGridView.DataBind()

ElseIf Province_Ddl.SelectedValue = "Province2" Then
                Dim Province2Municipality = From city In myEntities.CityTbls
                                        Where city.Province = "Province2"
                                        Order By city.City
                                        Select city.City

                cityGridView.DataSource = Province2Municipality
                cityGridView.DataBind()

ElseIf Province_Ddl.SelectedValue = "Province3" Then
                Dim Province3Municipality = From city In myEntities.CityTbls
                                        Where city.Province = "Province3"
                                        Order By city.City
                                        Select city.City

                cityGridView.DataSource = Province3Municipality
                cityGridView.DataBind()

.
.
.
.
.
.
End If
by the way, our country has more than 75 provinces so i handcoded and copy-pasted them one by one.
Reply With Quote