When you load on demand from a Web Service, is there a way to add fields to the "context" argument? In my test it contains only "NumberOfItems" and "Text".
Ideally I would like to gather more info about the calling RadCombo. Help anyone?
Thank you
Andrew
Ideally I would like to gather more info about the calling RadCombo. Help anyone?
Thank you
Andrew
6 Answers, 1 is accepted
0
Accepted
Hi Andrew,
You can refer to the Populate from WebService example and see how the text of the input field is passed to the context object. The same way you can pass other information about the combobox:
Hope this helps.
Regards,
Nick
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
You can refer to the Populate from WebService example and see how the text of the input field is passed to the context object. The same way you can pass other information about the combobox:
function itemRequesting(sender, eventArgs)
{
var context = eventArgs.get_context();
context["Filter"] = sender.get_text();
}
Hope this helps.
Regards,
Nick
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Andrew
Top achievements
Rank 1
answered on 02 Apr 2008, 09:44 PM
Great, thanks
0
Nesim
Top achievements
Rank 2
answered on 22 May 2008, 09:26 AM
Hi,
I did all like the sample but i get the failed error. No explaining :(
The HTML Codes:
The JavaScript Codes:
And The WebService Codes:
I did all like the sample but i get the failed error. No explaining :(
The HTML Codes:
|
||||||||
<script language="javascript" type="text/javascript"> |
function itemRequesting(sender, eventArgs) |
{ |
var context = eventArgs.get_context(); |
context["Filter"] = sender.get_text(); |
} |
</script> |
<Script.Services.ScriptService()> _ | |
Public Class WebServiceName | |
Inherits WebService | |
<WebMethod()> _ | |
Public Function GetMusteriler(ByVal context As Object) As Telerik.Web.UI.RadComboBoxItemData() | |
Dim oDatas(2) As Telerik.Web.UI.RadComboBoxItemData | |
Dim sMstAdi As String = context.ToString | |
If sMstAdi.Length > 2 Then | |
Dim ta As New DataAccess.KULLANICITableAdapters.ButunKullanicilarTableAdapter | |
Dim dt As DataAccess.KULLANICI.ButunKullanicilarDataTable = ta.GetDataByAdSoyad(sMstAdi) | |
ReDim oDatas(dt.Rows.Count - 1) | |
Dim dr As DataAccess.KULLANICI.ButunKullanicilarRow | |
For i As Integer = 0 To dt.Rows.Count - 1 | |
dr = dt.Rows(i) | |
oDatas(i).Text = dr.ADISOYADI | |
oDatas(i).Value = dr.KULLANICI_ID | |
Next | |
End If | |
Return oDatas | |
End Function | |
End Class |
0
Hello Nesim,
I think that the problem might be related to the fact that you are using context.ToString()
I suggest that you examine these online resources:
I hope this helps.
Sincerely yours,
Veskoni
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
I think that the problem might be related to the fact that you are using context.ToString()
I suggest that you examine these online resources:
I hope this helps.
Sincerely yours,
Veskoni
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Nesim
Top achievements
Rank 2
answered on 22 May 2008, 11:56 AM
Hello Veskoni,
I can't debug it what context returns becasue it doesn't hit when i breakpoint in vs. the event doesn't raise. webservice event. i tried to convert idictionary the context data.
Nothing different. Same Problem. The server method "GetMusteriler" failed.
I got the text from javascript.
it works ... but i need to more details.
How can i get detailed error exception? Or Stack trace ...
Thanks a lot
I can't debug it what context returns becasue it doesn't hit when i breakpoint in vs. the event doesn't raise. webservice event. i tried to convert idictionary the context data.
Dim dicCon As IDictionary = context
Dim sMstAdi As String = dicCon("Filter").ToString
Nothing different. Same Problem. The server method "GetMusteriler" failed.
I got the text from javascript.
alert(sender.get_text());
it works ... but i need to more details.
How can i get detailed error exception? Or Stack trace ...
Thanks a lot
0
Hi Nesim,
You can subscribe to the OnClientItemsRequestFailed event and examine the error message by calling eventArgs.get_errorMessage() method.
Regards,
Veskoni
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
You can subscribe to the OnClientItemsRequestFailed event and examine the error message by calling eventArgs.get_errorMessage() method.
Regards,
Veskoni
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center