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

Display Issues With ShowMoreResults And LoadOnDemand

1 Answer 51 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Shawn Moss
Top achievements
Rank 1
Shawn Moss asked on 06 Apr 2010, 06:43 PM

I have a combox with ShowMoreResults and LoadOnDemand Enabled:

<

 

telerik:RadComboBox ID="AccountIndustryTypeId" runat="server" DataTextField="TypeName" DataValueField="AccountIndustryTypeId" EnableLoadOnDemand="True" ShowMoreResultsBox="true" EnableVirtualScrolling="true" OnItemsRequested="AccountIndustryTypeId_ItemsRequested" MarkFirstMatch="True" Width="400">  

</telerik:RadComboBox> 
And and ItemsRequested event to retrieve some results : 

protected

 

void AccountIndustryTypeId_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)  

 

 

DataTable types = AccountIndustryTypesDA.AccountIndustryTypesSelectList(e.Text, false);

 ((

RadComboBox) o).Items.Clear();

 

 

 

try
{

 

 

 

 

 

int itemOffset = e.NumberOfItems;   

 

int endOffset = itemOffset + 15;  

 

if (endOffset > types.Rows.Count)  

{

endOffset = types.Rows.Count;

 

for (int i = itemOffset; i < endOffset; i++)  

 

RadComboBoxItem item = new RadComboBoxItem(types.Rows[i]["TypeName"].ToString(), types.Rows[i]["AccountIndustryTypeId"].ToString());

((

RadComboBox)o).Items.Add(item);

 

 

}

e.Message = types.Rows.Count > 0 ?

 

String.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset.ToString(), types.Rows.Count.ToString()) : "No matches";

 

catch

 

 

{

 

e.Message =

 

"No matches";  

}

}

 


When the ShowMoreResults image is clicked but no more results are actually retrieved the ShowMoreResults box is adding blank space.  How can I stop this??

 

1 Answer, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 07 Apr 2010, 10:25 AM
Hello Shawn Moss,

Thanks for your question.

When EnabledVirtualScrolling is set to "true", RadComboBox has it's own height. So to be able to remove this white space there a re two options:

1. Set ItemsPerRequest to 20 instead of 15.
2. Set a Height to the RadComboBox for example Height="330px".

Please let me know if this was helpful.

Kind regards,
Veronica Milcheva
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
ComboBox
Asked by
Shawn Moss
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Share this question
or