Populate dropdownlist inside a gridview

后端 未结 2 915
被撕碎了的回忆
被撕碎了的回忆 2021-01-29 06:11

I have a Dropdownlist in a Gridview and i have to show the records associated with every id.And the ID contains more than 10 records so how can i show them??

 pr         


        
2条回答
  •  梦如初夏
    2021-01-29 06:42

    We just ran into this issue where I work. Our way around this problem was to first get the DropDownLists UniqueID. This is basically a Client ID. Inside of that ID is a reference to the row of the GridView that it was selected from. THE ONLY PROBLEM is that it seems to add 2 to the row count. So if you select Row 1's DropdownList, the Unique ID will bring you a reference to the 3rd row. So:

    Get the unique ID > Split it however you need to to get the row > use the row number to get the values you need.

提交回复
热议问题