How to identify dynamic number of input boxes

3 posts, 1 answers
  1. DuelingCats
    DuelingCats avatar
    49 posts
    Member since:
    Jul 2012

    Posted 09 Jan 2013 Link to this post

    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. Answer
    Eyup
    Admin
    Eyup avatar
    3014 posts

    Posted 14 Jan 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. DuelingCats
    DuelingCats avatar
    49 posts
    Member since:
    Jul 2012

    Posted 14 Jan 2013 Link to this post

    Thanks for your help, those demos proved helpful.
Back to Top