Hi Forum,
I have a RADGrid with a RADComboBox column with EnableLoadOnDemand=true and ItemsRequest event defined.
The automatic CRUD operation enabled on the Grid doesn't work, so the value of RADComboBox never change after update of then EditForm and is setted to NULL when I perform a created operation.
If I bind the Combobox to a Datasource object by the property DataSourceID and I disable EnableLoadOnDemand without implement OnItemsRequest event , CRUD works fine. I have a lot of records to show in ComboBox therefore Loading data on demand is very important.
Thanks to all for any response.
Gaetano
I have a RADGrid with a RADComboBox column with EnableLoadOnDemand=true and ItemsRequest event defined.
<telerik:RadComboBox ID="cboLocalita"
EnableVirtualScrolling="true"
OnItemsRequested="cboLocalita_ItemsRequested"
ShowMoreResultsBox="true"
EnableLoadOnDemand="true"
DataTextField ="descrizione"
DataValueField ="idlocalita"
runat="server">
</telerik:RadComboBox>
Protected Sub cboLocalita_ItemsRequested(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs)
Dim context As New JLogTabelleDataContext
Dim allLocalita = From localita In context.localita _
Order By localita.descrizione _
Select localita
If Not [String].IsNullOrEmpty(e.Text) Then
allLocalita = From localita In context.localita _
Where localita.descrizione.StartsWith(e.Text) _
Order By localita.descrizione _
Select localita
End If
Dim Lstlocalita = allLocalita.Skip(e.NumberOfItems).Take(10)
CType(o, RadComboBox).DataSource = Lstlocalita
CType(o, RadComboBox).DataBind()
Dim endOffset As Integer = e.NumberOfItems + Lstlocalita.Count()
Dim totalCount As Integer = allLocalita.Count()
If endOffset = totalCount Then
e.EndOfItems = True
End If
e.Message = [String].Format("Rec <
b
>1</
b
>-<
b
>{0}</
b
> Tot <
b
>{1}</
b
>", endOffset, totalCount)
End Sub
The automatic CRUD operation enabled on the Grid doesn't work, so the value of RADComboBox never change after update of then EditForm and is setted to NULL when I perform a created operation.
If I bind the Combobox to a Datasource object by the property DataSourceID and I disable EnableLoadOnDemand without implement OnItemsRequest event , CRUD works fine. I have a lot of records to show in ComboBox therefore Loading data on demand is very important.
Thanks to all for any response.
Gaetano