Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7796341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:20:46+00:00 2026-06-01T23:20:46+00:00

I have a DataGrid with VirtualizationMode=Recycling that is bound to an ObservableCollection in my

  • 0

I have a DataGrid with VirtualizationMode="Recycling" that is bound to an ObservableCollection in my ViewModel. It works fine – scrolling and page up/down is fast.

Now I add a further DataGridTemplateColumn with an ItemsControl in its DataTemplate. It is bound to about 15 items (for all rows same count). Now scrolling is much much slower. But if the underlying Collection is Null all is fast again. I assume that the generated ItemContainers in each row will not be recycled.

Is there a way to speed up the whole process or even better recycle all nested controls in the row?

PS: I would prefer a ItemsControl in a DataGridColumn, not a DataGridColumn for each Item in Collection.

<DataGridTemplateColumn>
    <DataGridTemplateColumn.CellTemplate>
        <DataTemplate>
            <ItemsControl ItemsSource="{Binding AObservableCollection}">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Horizontal" />
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <TextBox Text="{Binding AStringProperty}" Width="40" />
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T23:20:48+00:00Added an answer on June 1, 2026 at 11:20 pm

    After doing some further research I can say: the problem is not the creation of container itself, but the content of container. 15 TextBoxes are heavier then I thought. I’ve replaced the TextBox with TextBlock and it was as fast as before.

    Because I need editing I changed DataGridTemplateColumn.CellTemplate into DataGridTemplateColumn.CellEditingTemplate and created a new CellTemplate with a TextBlock. I switch the templates with:

    <DataGrid.CellStyle>
        <Style TargetType="{x:Type DataGridCell}">
            <Style.Triggers>
                <Trigger Property="IsSelected" Value="True">
                    <Setter Property="IsEditing" Value="True" />
                </Trigger>
            </Style.Triggers>
        </Style>
    </DataGrid.CellStyle>
    

    so only the selected cell/row shows a TextBox.

    Of course, now I have new problems with Focusmanagement and Keyboardnavigation. But I think I have to do it this way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a DataGrid bound to a ViewModel's property of type ObservableCollection. Inside DataGrid
I have a datagrid that's bound to an observablecollection object. The collection may be
I have a datagrid bound to an ObservableCollection, and what I'd like to do
I have datagrid with paging enabled that can have 10 rows per page. Also
I have a DataGrid that binding an ObservableCollection of self tracking entities Users can
I have a datagrid bound to an ObservableCollection<MyClass> , and I have another datagrid
I have a DataGrid component that displays a few columns of data. It has
I have a datagrid column with a button that opens a modal dialog box
I have a DataGrid bound to a DataView which, among other columns has, an
I have a datagrid, that has as its base an XML file. Depending on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.