Programatic Virtualization

3 posts, 1 answers
  1. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 14 Apr 2011 Link to this post

    I'm having some trouble with the syntax.  I'm trying to replicate
    <telerik:RadComboBox.ItemsPanel>
        <ItemsPanelTemplate>
            <VirtualizingStackPanel />
        </ItemsPanelTemplate>
    </telerik:RadComboBox.ItemsPanel>

    I tried

    .rcMatter.ItemsPanel = (

     

    ItemsPanelTemplate)Resources["VirtualizingStackPanel"];

     


    That will work to take it away, but not make it virtualizating.  Maybe it's a difffernt name I need?
  2. Answer
    George
    Admin
    George avatar
    1332 posts

    Posted 20 Apr 2011 Link to this post

    Hello ,

    I would suggest you defining the ItemsPanelTemplate as Resources:

    <UserControl.Resources>
            <ItemsPanelTemplate x:Key="virtualizingStackPanel">
                <VirtualizingStackPanel />
            </ItemsPanelTemplate>  
    </UserControl.Resources>

    and set it  to the RadComboBox.ItemsPanel in the code-behind like this:

    this.combo.ItemsPanel = this.Resources["virtualizingStackPanel"] as ItemsPanelTemplate;

    I hope this helps.


    Kind regards,
    George
    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
  3. DevCraft banner
  4. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 20 Apr 2011 Link to this post

    Ahh, thanks, I didn't see I needed to use it as a resource.
Back to Top