UWP - ListBox with 2 Columns with Border causing huge Peformance Issue.

Indudhar Gowda 426 Reputation points
2020-09-15T06:38:20.947+00:00

UWP - ListBox with 2 Columns with Border causing huge Peformance Issue.

 <DataTemplate x:Name="TestTemplate">
                <Border
                    Height="30"
                    Margin="0,0,0,-12"
                    HorizontalAlignment="Stretch"
                    BorderBrush="#A1A0A0"
                    BorderThickness="0,0,0,1">
                    <RelativePanel>
                        <TextBlock
                            x:Name="FirstTextBlock"
                            Width="300"
                            Margin="40,0,0,0"
                            VerticalAlignment="Center"
                            FontSize="14"
                            RelativePanel.AlignLeftWithPanel="True"
                            RelativePanel.LeftOf="Divider"
                            Text="{Binding Name}" />
                        <Border
                            x:Name="Divider"
                            Width="0.1"
                            Background="#ECECEC"
                            RelativePanel.AlignHorizontalCenterWithPanel="True" />
                        <TextBlock
                            x:Name="SecondTextBlock"
                            Margin="40,0,0,0"
                            VerticalAlignment="Center"
                            FontSize="14"
                            RelativePanel.AlignRightWithPanel="True"
                            RelativePanel.RightOf="Divider"
                            Text="{Binding ModuleName}" />
                    </RelativePanel>
                </Border>
            </DataTemplate>

<ListBox
                x:Name="RoutineGrid"
                Margin="5,0,5,0"
                HorizontalAlignment="Stretch"
                VerticalAlignment="Stretch"
                HorizontalContentAlignment="Stretch"
                Background="#FFFFFFFF"
                ItemTemplate="{StaticResource TestTemplate}"
                ItemsSource="{Binding TestCollection}"
                SelectedItem="{Binding SelectedItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                SelectionMode="Single">                
            </ListBox>

1 Column is Working Fine, But 2 Columns is causing issue, I need 2 Columns.

Universal Windows Platform (UWP)
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.