I have a gridview created in asp.net within Visual Studio.
There are some control parameters in my SqlDataSource1 to identify some drop down lists for editing within my gridview. I currently have the "ControlID" property hard coded based on the name of the drop down list I saw in by viewing the source in the browser:
<UpdateParameters>
<asp:ControlParameter Name="origin"ControlID="GridView1$ctl02$DropDownList1" PropertyName="SelectedValue" />
<asp:ControlParameter Name="portofload" ControlID="GridView1$ctl02$DropDownList2" PropertyName="SelectedValue" />
<asp:ControlParameter Name="portofdischarge" ControlID="GridView1$ctl02$DropDownList3" PropertyName="SelectedValue" />
<asp:ControlParameter Name="vessel" ControlID="GridView1$ctl02$DropDownList4" PropertyName="SelectedValue" />
</UpdateParameters>
Currently, it only works when I click "edit" on the first row of my gridview, all the other rows can't find that ID (naturally, because the value I put in is only for the first row). Since the numbers within the names like "GridView1$ctl02$DropDownList1" seem to incitement in a pattern , I want to dynamically edit the ControlID string so it actually corresponds with the row the "edit" button is clicked in. I currently have a variable being generated based on the row I'm in when the edit button is pressed, but I have no idea how to dynamically update the ControlID property of the corresponding ControlParameter.
Thanks