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

EditItemTemplate LoadOnDemand

5 Answers 72 Views
Grid
This is a migrated thread and some comments may be shown as answers.
JSON
Top achievements
Rank 1
JSON asked on 10 Dec 2013, 12:27 PM
Greetings,

I have a RadComboBox in an EditItemTemplale that uses LoadOnDemand. In the OnItemsRequested method, I need to access the RadComboBox's input value (not selected value), but have had no luck. I have researched and tested many solutions/examples of similar issues without any success.

Thanks,
SteveO...

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 10 Dec 2013, 12:56 PM
Hi,

I guess you want to access the already selected value of the RadComboBox. Please try the following code snippet.

ASPX:
protected void RadComboBox1_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
{
  RadComboBox combo = (RadComboBox)sender;
  string input = combo.Text;// Get the input text here      
}

Thanks,
Princy
0
JSON
Top achievements
Rank 1
answered on 10 Dec 2013, 01:26 PM
Princy,

No, not a selected value, a markfirstmatch input value firing off the OnItemsRequested event. Basically, load on demand functionality in an EditItemTemplate wrapper.

SteveO...
0
Princy
Top achievements
Rank 2
answered on 11 Dec 2013, 06:34 AM
Hi,

I guess you want to access the RadComboBoxItem value that matches with the 'MarkFirstMatch' on ItemsRequested event.

C#:
protected void RadComboBox2_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
{
    Telerik.Web.UI.RadComboBox combo = (Telerik.Web.UI.RadComboBox)sender;
    foreach (RadComboBoxItem item in combo.Items)
    {
        if(item.Text.StartsWith(e.Text))
        {
            string text = item.Text;
            break;
        }
    }
}

Thanks,
Princy.
0
JSON
Top achievements
Rank 1
answered on 11 Dec 2013, 12:14 PM
Princy,

Yes, your example references the text value of the RadComboBox, which is not the mark first match value entered.
I need the input value entered, and not the matched returned value. Make sense, or am I not understanding?

Thanks,
Steve
0
JSON
Top achievements
Rank 1
answered on 11 Dec 2013, 12:49 PM
Princy,

Please accept my apology, as I was able to resolve the issue myself. Basically all I needed to do was reference the RadComboBoxItemsRequestedEventArg, and there it is.

Thanks for all your help,
SteveO...
Tags
Grid
Asked by
JSON
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
JSON
Top achievements
Rank 1
Share this question
or