I looked for this issue, but I wasn't quite sure how to word the search so here goes
I have a Listview that displays items in a database
I added a button to each line that when clicked adds that item number to a Specific Job Number,
I can handle the click event by adding the ItemId to the command argument on the button
Now to complicate matters, I added a dropdownlist with qty, but being a separate control, i don't know what I would add to submit the qty as well as the Item to the List
You can do this by finding the dropdown in its parent. Means, First get the parent of the button ClickedButton.Parent and cast it it. Then try to find the dropdown with its id DropDownList1 and get the quatity.
Member
8 Points
100 Posts
ListView Button Click With Control SelectedValue
Nov 08, 2016 04:38 AM|RobertH3|LINK
I looked for this issue, but I wasn't quite sure how to word the search so here goes
I have a Listview that displays items in a database
I added a button to each line that when clicked adds that item number to a Specific Job Number,
I can handle the click event by adding the ItemId to the command argument on the button
Now to complicate matters, I added a dropdownlist with qty, but being a separate control, i don't know what I would add to submit the qty as well as the Item to the List
I need to add the qty from DropDownList 1 to Button1_Click
C#
Member
20 Points
19 Posts
Re: ListView Button Click With Control SelectedValue
Nov 08, 2016 04:56 AM|navakiran|LINK
You can do this by finding the dropdown in its parent. Means, First get the parent of the button ClickedButton.Parent and cast it it. Then try to find the dropdown with its id DropDownList1 and get the quatity.
All-Star
52523 Points
15670 Posts
Re: ListView Button Click With Control SelectedValue
Nov 08, 2016 07:02 AM|oned_gk|LINK
Here how to get other values when you click the button
Suwandi - Non Graduate Programmer
Member
8 Points
100 Posts
Re: ListView Button Click With Control SelectedValue
Nov 08, 2016 01:01 PM|RobertH3|LINK
Awesome - Thanks