Click here to Skip to main content
15,887,776 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have a table with 4 columns, and i am binding these columns to different DropdownLists. I need to get that, if i change any dropdownlist value, the remaining dropdwonlist should effect with that respected row.
I have table Like this,

id	Name	FatherName	MotherName
1	Name1	Father1 	Mother1
2	Name2	Father2 	Mother2
3	Name3	Father3 	Mother3
4	Name4	Father4 	Mother4



DropDownList1 is Bind with first Column (id),
DropDownList1 is Bind with second Column (Name),
..
..and so on..

If i select id as 1, the Dropdownlist2 should auto select to Name1, and DropDownList3 is to Father1...and so on..

if i change dropdownlist2 value, same as above remaining dropdownlists should effect..

How can i get it by using Apc.net(C#)..

Please help..
Posted

1 solution

Logic

  1. Use OnSelectedIndexChanged Method[^] of DropDownList.
  2. Get the Selected Value.
  3. Loop through the DataTable and find the Row where it has that Selected Value (id).
  4. Get required column values (the DropDown values, which need to be selected) in that Row.
  5. Select all other DropDown by the values we got in previous step.
 
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