Drop down control.
-
Hi Friend, This is normal but want to know how it's done. I have multiple drop down on one form which are related to each other. Country Drop down City Drop down Location Drop down If user select Country it will fill drop down and so on, but when user again select new country system should clear the related drop down it's working fine but because of that its taking time which is issue need to know how to speed this. thanks in advance. Sasmi
-
Hi Friend, This is normal but want to know how it's done. I have multiple drop down on one form which are related to each other. Country Drop down City Drop down Location Drop down If user select Country it will fill drop down and so on, but when user again select new country system should clear the related drop down it's working fine but because of that its taking time which is issue need to know how to speed this. thanks in advance. Sasmi
Are you hitting database everytime country selection is changed? That will slow things down. Unless you show some code about how you are doing this, it would be tough to help.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
-
Hi Friend, This is normal but want to know how it's done. I have multiple drop down on one form which are related to each other. Country Drop down City Drop down Location Drop down If user select Country it will fill drop down and so on, but when user again select new country system should clear the related drop down it's working fine but because of that its taking time which is issue need to know how to speed this. thanks in advance. Sasmi
-
Are you hitting database everytime country selection is changed? That will slow things down. Unless you show some code about how you are doing this, it would be tough to help.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
-
-
Which code is populating the dropdown boxes? What part of the code is slow? If you're searching through a database, have you used the WHERE clause, or are you just iterating over the results when the list is populated?
OSDev :)
thanks for your quick response me using following query to fill dropdown "select CountryName, CountryID from CountryTable" "select CityName, CityID from CityDetails where CountryID = 1" "select LocationName, LocationID from LocationDetails wherer CityID = 1" this way the data has been retrive from database but before that i want to clearify at page Load it initialize each control DropDown1.Items.Clear() ListItem _Item = new ListItem("-Select Country-",0) DropDown1.Items.Insert(_Item, 0) DropDown2.Items.Clear() ListItem _Item = new ListItem("-Select City-",0) DropDown2.Items.Insert(_Item, 0) DropDown3.Items.Clear() ListItem _Item = new ListItem("-Select Location-",0) DropDown3.Items.Insert(_Item, 0) when i change selection of Country drop down again DropDown2.Items.Clear() ListItem _Item = new ListItem("-Select City-",0) DropDown2.Items.Insert(_Item, 0) DropDown3.Items.Clear() ListItem _Item = new ListItem("-Select Location-",0) DropDown3.Items.Insert(_Item, 0) this way its coded.. hope you get what i coded on my form sasmi
-
Are you hitting database everytime country selection is changed? That will slow things down. Unless you show some code about how you are doing this, it would be tough to help.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
thanks for your quick response me using following query to fill dropdown "select CountryName, CountryID from CountryTable" "select CityName, CityID from CityDetails where CountryID = 1" "select LocationName, LocationID from LocationDetails wherer CityID = 1" this way the data has been retrive from database but before that i want to clearify at page Load it initialize each control DropDown1.Items.Clear() ListItem _Item = new ListItem("-Select Country-",0) DropDown1.Items.Insert(_Item, 0) DropDown2.Items.Clear() ListItem _Item = new ListItem("-Select City-",0) DropDown2.Items.Insert(_Item, 0) DropDown3.Items.Clear() ListItem _Item = new ListItem("-Select Location-",0) DropDown3.Items.Insert(_Item, 0) when i change selection of Country drop down again DropDown2.Items.Clear() ListItem _Item = new ListItem("-Select City-",0) DropDown2.Items.Insert(_Item, 0) DropDown3.Items.Clear() ListItem _Item = new ListItem("-Select Location-",0) DropDown3.Items.Insert(_Item, 0) this way its coded.. sasmi
-
thanks for your quick response me using following query to fill dropdown "select CountryName, CountryID from CountryTable" "select CityName, CityID from CityDetails where CountryID = 1" "select LocationName, LocationID from LocationDetails wherer CityID = 1" this way the data has been retrive from database but before that i want to clearify at page Load it initialize each control DropDown1.Items.Clear() ListItem _Item = new ListItem("-Select Country-",0) DropDown1.Items.Insert(_Item, 0) DropDown2.Items.Clear() ListItem _Item = new ListItem("-Select City-",0) DropDown2.Items.Insert(_Item, 0) DropDown3.Items.Clear() ListItem _Item = new ListItem("-Select Location-",0) DropDown3.Items.Insert(_Item, 0) when i change selection of Country drop down again DropDown2.Items.Clear() ListItem _Item = new ListItem("-Select City-",0) DropDown2.Items.Insert(_Item, 0) DropDown3.Items.Clear() ListItem _Item = new ListItem("-Select Location-",0) DropDown3.Items.Insert(_Item, 0) this way its coded.. sasmi
-
Are you hitting database everytime country selection is changed? That will slow things down. Unless you show some code about how you are doing this, it would be tough to help.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
Check valid field when pass to Controls
Công ty Đất Quảng - Cong ty Dat Quang - http://datquangda.com.vn Bất động sản, mua bán nhà đất khu đô thị mới Nam An Khánh Hà Nội. Trụ sở: Phòng 303 nhà N6E – Trung Hoà Nhân Chính – Thanh Xuân – Hà Nội - Vietnam Văn phòng giao dịch: Số nhà 10, ngách 23, ngõ 61, Trần Duy Hưng, Trung Hòa, Cầu Giấy, Hà Nội, Vietnam Điện thoai: 04.3556 2516 - 3556 2552 - 2247 5733 Fax: 04.3556 2566 - 3556 2140 Email:datquangda@gmail.com Website: http://www.datquangda.com.vn
-
Check valid field when pass to Controls
Công ty Đất Quảng - Cong ty Dat Quang - http://datquangda.com.vn Bất động sản, mua bán nhà đất khu đô thị mới Nam An Khánh Hà Nội. Trụ sở: Phòng 303 nhà N6E – Trung Hoà Nhân Chính – Thanh Xuân – Hà Nội - Vietnam Văn phòng giao dịch: Số nhà 10, ngách 23, ngõ 61, Trần Duy Hưng, Trung Hòa, Cầu Giấy, Hà Nội, Vietnam Điện thoai: 04.3556 2516 - 3556 2552 - 2247 5733 Fax: 04.3556 2566 - 3556 2140 Email:datquangda@gmail.com Website: http://www.datquangda.com.vn
-
thanks for your quick response me using following query to fill dropdown "select CountryName, CountryID from CountryTable" "select CityName, CityID from CityDetails where CountryID = 1" "select LocationName, LocationID from LocationDetails wherer CityID = 1" this way the data has been retrive from database but before that i want to clearify at page Load it initialize each control DropDown1.Items.Clear() ListItem _Item = new ListItem("-Select Country-",0) DropDown1.Items.Insert(_Item, 0) DropDown2.Items.Clear() ListItem _Item = new ListItem("-Select City-",0) DropDown2.Items.Insert(_Item, 0) DropDown3.Items.Clear() ListItem _Item = new ListItem("-Select Location-",0) DropDown3.Items.Insert(_Item, 0) when i change selection of Country drop down again DropDown2.Items.Clear() ListItem _Item = new ListItem("-Select City-",0) DropDown2.Items.Insert(_Item, 0) DropDown3.Items.Clear() ListItem _Item = new ListItem("-Select Location-",0) DropDown3.Items.Insert(_Item, 0) this way its coded.. sasmi
You seem to hitting database all the time. Get the list in one go and cache it. Then, all you need is to filter the datasource for second and third dropdowns. BTW give your controls a descriptive name.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!