How do display multiple columns in the load by demand example?
The following code from the multi-col does not display the data.
Do I have to bind the datatable to the combox for this to work.
It seems the databinding to the radcombo takes a while.. thanks in advance.
<
HeaderTemplate>
<table style="width: 100%; text-align: left">
<tr>
<td style="width: 125px;">
Company Name
</td>
<td style="width: 125px;">
City
</td>
<td style="width: 125px;">
Title
</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table style="width: 100%; text-align: left">
<tr>
<td style="width: 125px;">
<%
# DataBinder.Eval(Container.DataItem, "CompanyName") %>
</td>
<td style="width: 125px;">
<%
# DataBinder.Eval(Container.DataItem, "City") %>
</td>
<td style="width: 125px;">
<%
# DataBinder.Eval(Container.DataItem, "ContactTitle") %>
</td>
</tr>
</table>
</ItemTemplate>
17 Answers, 1 is accepted
You need to call DataBind() method of RadComboBoxItems. This will evaluate the databinding expressions.
For an example you can see our online demo-http://www.telerik.com/DEMOS/ASPNET/Prometheus/Combobox/Examples/Functionality/MultiColumnCombo/DefaultCS.aspx
Greetings,
Rosi
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Is thier anyway around it?
I'd like to get the performace like the load by demand example.
I'm looking for a fast multi-column load by demand example
thanks
You can add items at runtime in the ItemsRequested event of RadComboBox without using databindings.
For an example:
| Protected Sub RadComboBox1_ItemsRequested(ByVal sender As Object, ByVal e As RadComboBoxItemsRequestedEventArgs) |
| RadComboBox1.Items.Add(new RadComboBoxItem("text", "value") |
| End Sub |
Hope this helps.
Kind regards,
Rosi
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
thanks again
This would not be an easy task and it would slow down the combobox' performance. You can, however, try to use RadGrid inside combobox, as shown at:
LOD Grid in ComboBox
Kind regards,
Nick
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
I tpe in 104 into the text part and nothing happens?
Please type 104 and click on the dropdown arrow to open the combobox.
Kind regards,
Veselin Vasilev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
So this really is not a on load demand scenario? Meaning when someone types you expect the load to begin then. And it doesn't have the more capability at the bottom for paging.
and if I type "10" it won't do anything.
thanks, for the help I now know this won't work for my requirements.
That example does not show load on demand combobox, but a load on demand grid.
This example shows a multi-column combobox with load on demand
All the best,
Veselin Vasilev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
That example, unfortunately, does *not* show an on load demand with multi columns
This is your demo code below. In the *demo* code you do not see the following three lines. They are not there.
ShowMoreResultsBox="true"
EnableLoadOnDemand="true"
EnableVirtualScrolling = "true"
in its definition.
Demo code combo definition.
| <telerik:RadComboBox |
| runat="server" ID="RadComboBox1" |
| Height="190px" Width="420px" |
| Skin="Vista" |
| MarkFirstMatch="true" |
| DataSourceID="SessionDataSource1" |
| EnableLoadOnDemand="true" |
| HighlightTemplatedItems="true" |
| OnClientItemsRequested="UpdateItemCountField" |
| OnDataBound="RadComboBox1_DataBound" |
| OnItemDataBound="RadComboBox1_ItemDataBound" |
| OnItemsRequested="RadComboBox1_ItemsRequested"> |
| <HeaderTemplate> |
| <ul> |
| <li class="col1">Contact Name</li> |
| <li class="col2">City</li> |
| <li class="col3">Title</li> |
| </ul> |
| </HeaderTemplate> |
| <ItemTemplate> |
| <ul> |
| <li class="col1"><%# DataBinder.Eval(Container.DataItem, "ContactName") %></li> |
| <li class="col2"><%# DataBinder.Eval(Container.DataItem, "City") %></li> |
| <li class="col3"><%# DataBinder.Eval(Container.DataItem, "ContactTitle") %></li> |
| </ul> |
| </ItemTemplate> |
| <FooterTemplate> |
| A total of <asp:Literal runat="server" ID="RadComboItemsCount" /> items |
| </FooterTemplate> |
| </telerik:RadComboBox> |
The demo does show load on demand. The EnableLoadOnDemand property is set to True and the combobox is subscribed to ItemsRequested event.
I suppose you expected to have VirtualScrolling / ShowMoreResults.
In order to have these you should not call the DataBind method in ItemsRequested event. Instead, you should manually iterate through the Rows of the dataset and create the combo's items as shown in this example.
I hope it will be straighforward for you to combine both examples.
Best wishes,
Veselin Vasilev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
In the last example you reference, they are adding a RadComboBoxItem in the ItemsRequested server-side event. How do you set an item with more than one value, ie. col1,col2,col3. The RadComboBoxItem only has 2 values, one for the text and one for the value. How can the item template of the combobox bind to more than one value and how you do this binding with enablevirtualscrolling=true?
Thanks,
Jay
Please find attached a simple page demonstrating the needed approach.
All the best,
Yana
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
jay
item template of the combo within the aspx:
<
ItemTemplate>
<table style="width: 450px; text-align: left">
<tr>
<td style="width: 100px;">
<%
#DataBinder.Eval(Container, "Attributes(""Level1"")")%>
</td>
<td style="width: 150px;">
<%
#DataBinder.Eval(Container, "Attributes(""Level2"")")%>
</td>
<td style="width: 200px;">
<%
#DataBinder.Eval(Container, "Attributes(""Level3"")")%>
</td>
</tr>
</table>
</ItemTemplate>
in server-side code of the itemsrequested event i have this:
oCBItem =
New RadComboBoxItem()
oCBItem.Attributes.Add(
"Level1", "val for first col")
oCBItem.Attributes.Add(
"Level2", "val for second col")
oCBItem.Attributes.Add(
"Level3", "val for third col")
rcboSystem.Items.Add(oCBItem)
oCBItem.DataBind()
Maybe your problem is that your aspx field does not match your code behind field within the itemseventrequested event. Hope that helps.
