开发者

Databound Checkbox list with textboxes in a webform

I'm having trouble coming up with a solution for the following problem and i was wondering if someone here would help me out.

I need to pull a list of supplies from a db table and list them along with two textboxes (one for quantity, and another for manufacturer)

so the list would look something like this.

checkbox for supply 1 | Quantity | Manufacturer
checkbox for supply 2 | Quantity | Manufacturer

..

I also need to store all of the checked items in a db table. I'm not sure how i should go about doing th开发者_运维问答is. I've heard some talk about a repeater control being useful but i've not come across any examples that do this type of thing.

Thanks in advance


I've used the ListView for things like this, but Repeater probably woudl work too; simply create the ItemTemplate with these controls. On a button click, you can loop through the ListView.Items collection, using FindControl to find the checkbox, and if checked, get the textbox values.

It's pretty easy to setup.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜