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

How do I get the value from the textbox?

2 Answers 166 Views
InputPrompt
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Delilah
Top achievements
Rank 1
Delilah asked on 13 Feb 2013, 06:19 AM
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 Answers, 1 is accepted

Sort by
0
Delilah
Top achievements
Rank 1
answered on 14 Feb 2013, 01:22 AM
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
}
0
Todor
Telerik team
answered on 14 Feb 2013, 08:32 AM
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.
Tags
InputPrompt
Asked by
Delilah
Top achievements
Rank 1
Answers by
Delilah
Top achievements
Rank 1
Todor
Telerik team
Share this question
or