How do I get the value from the textbox?

3 posts, 0 answers
  1. Delilah
    Delilah avatar
    6 posts
    Member since:
    Jan 2013

    Posted 13 Feb 2013 Link to this post

    The documentation states the following:
    RadInputPrompt.Show("Title", closedHandler: (args) => { this.Name = args.Text; });

    however I have a loop below it and I am trying to use the args.Text value in that loop. How would I do this?
    example:
    for(int x=0; x <= something.length; x++) {
    // output args.Text here -- each item needs to have the args.Text value.
    }


  2. Delilah
    Delilah avatar
    6 posts
    Member since:
    Jan 2013

    Posted 13 Feb 2013 Link to this post

    Nevermind, I decided to create a class.

     RadInputPrompt.Show("Title", MessageBoxButtons.OKCancel, vibrate: false, closedHandler: (args) => { string value = args.Text; Capture(value); });

    Then created a class:
    private void Capture(string someValue)
    {
    // stored the value
    }
  3. DevCraft banner
  4. Todor
    Admin
    Todor avatar
    778 posts

    Posted 14 Feb 2013 Link to this post

    Hi Delilah,

    Thank you for contacting us.

    Yes, you can use the class you have defined. Another option is to use a local variable for example:
    string result;
    RadInputPrompt.Show("Title", MessageBoxButtons.OKCancel, vibrate: false, closedHandler: (args) => { result = args.Text; });
    for (int i = 0; i < something.Length; i++)
    {
        item[i] = result;
    }
    And the other is to handle the value in the handler itself:
    RadInputPrompt.Show("Title", MessageBoxButtons.OKCancel, vibrate: false, closedHandler: (args) =>
    {
        for (int i = 0; i < something.Length; i++)
        {
            item[i] = args.Text;
        }
    });

    I hope this information helps.

    Kind regards,
    Todor
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Back to Top