This is a migrated thread and some comments may be shown as answers.

How to identify dynamic number of input boxes

2 Answers 43 Views
Input
This is a migrated thread and some comments may be shown as answers.
DuelingCats
Top achievements
Rank 2
DuelingCats asked on 09 Jan 2013, 05:53 PM
I am in a situation where a user will have a variable number of items and beside each item I want a RadNumericTextBox. I was thinking of using the RadListView and setting the template to be the item name and a RadNumericTextBox associated with it. I want to ignore the edit, create, and the more advanced features of the RadListView. I just want a list of items with the input boxes that will auto post back.

The problem I am facing is when a user changes a number in the text box, how do I know which text box this is? I was looking to see if there was a attribute on RadNumericTextBox that could hold an arbitrary value such as my item key so I would know which number they changed. However, I don't see such an attribute.

Is there some way I can make a determination which text box they edited when I auto post back? 

In case anyone asks, I do not want to force my user to click a button to make the row go into edit mode, change the number, then click a button to save the row.

2 Answers, 1 is accepted

Sort by
0
Accepted
Eyup
Telerik team
answered on 14 Jan 2013, 09:55 AM
Hi Justin,

Thank you for contacting us.

You can access the corresponding dataitem by getting the parent container of the textbox:
 (sender as RadNumericTextBox).NamingContainer.

Furthermore, you can check out the following examples for processing multiple updates on a single click:
   Batch Server Update    
   Performing Batch Updates
   http://demos.telerik.com/aspnet-ajax/calendar/examples/datepicker/shareddatepicker/defaultcs.aspx?product=grid

I hope this will prove helpful. Please give it a try and let us know if it works for you.

Regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
DuelingCats
Top achievements
Rank 2
answered on 14 Jan 2013, 02:06 PM
Thanks for your help, those demos proved helpful.
Tags
Input
Asked by
DuelingCats
Top achievements
Rank 2
Answers by
Eyup
Telerik team
DuelingCats
Top achievements
Rank 2
Share this question
or