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

Background Problem in DataBoundListBox

4 Answers 34 Views
DataBoundListBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Anagh
Top achievements
Rank 2
Anagh asked on 01 Jul 2014, 03:17 PM
I have got a DataBoundListBox. And the DataBoundListBoxitems can be images, text, audio,video etc. The Items are fetched using an API and most of the times the list becomes too long. I have to set the background of the DataBoundListBox depending on the data arriving. Let say, I set the background of DataBoundListBox as White. The problem is that in the long list I only see the background only to a certain extent after which the background becomes transparent. If I set the background of Grid in which DataBoundListBox is put, it doesn't work either.

I do not if it is a bug or am I doing it completely wrong?

Please look at the image attached.

4 Answers, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 04 Jul 2014, 08:41 AM
Hi Anagh,

Can you elaborate a little more on the scenario - is the DataBoundListBox has custom template, what container is it added in, what is the ItemTemplate defined. Generally the control fills the entire rendered area with the background applied.

Regards,
Tsvyatko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Anagh
Top achievements
Rank 2
answered on 04 Jul 2014, 03:46 PM
This is my code which is inside a PivotItem

<ScrollViewer Margin="0,50,0,0" ManipulationCompleted="ProjectScroll_ManipulationCompleted" ManipulationStarted="ProjectScroll_ManipulationStarted" MouseMove="ScrollViewer_MouseMove">
                    <Grid>
                        <telerikPrimitives:RadDataBoundListBox ScrollViewer.VerticalScrollBarVisibility="Disabled"  EmptyContentDisplayMode="DataSourceNull" >
                            <telerikPrimitives:RadDataBoundListBox.EmptyContentTemplate>
                                <DataTemplate>
                                    <customcontrols:ProgressRing  Width="80" Height="80" IsActive="True" HorizontalAlignment="Center" />
                                </DataTemplate>
                            </telerikPrimitives:RadDataBoundListBox.EmptyContentTemplate>
                            <telerikPrimitives:RadDataBoundListBox.ItemTemplate>
                                <DataTemplate>
                                    <local:ModuleTemplateSelector Content="{Binding}" >
                                        <local:ModuleTemplateSelector.Image>
                                            <DataTemplate>
                                                <StackPanel Margin="20,10">
                                                    <Image Source="{Binding src}"></Image>
                                                </StackPanel>
                                            </DataTemplate>
                                        </local:ModuleTemplateSelector.Image>
                                        <local:ModuleTemplateSelector.Text>
                                            <DataTemplate>
                                                <TextBlock Text="{Binding text_plain}" Margin="10" TextWrapping="Wrap" Foreground="Black" ></TextBlock>
                                            </DataTemplate>
                                        </local:ModuleTemplateSelector.Text>
                                    </local:ModuleTemplateSelector>
                                </DataTemplate>
                            </telerikPrimitives:RadDataBoundListBox.ItemTemplate>
                        </telerikPrimitives:RadDataBoundListBox>
                    </Grid>
                </ScrollViewer>

I got the problem solved. The main problem is I am using an external ScrollViewer (which I need for a "Go To Top" feature). If I remove this scrollviewer, I get the background as needed. But with ScrollViewer present there, the problem persists.

Thanks.


0
Accepted
Tsvyatko
Telerik team
answered on 09 Jul 2014, 02:08 PM
Hello Anagh,

Thank you for sharing this additional information. Generally, RadDataBoundListBox does not perform well when nested in ScrollViewer, due to its virtualizing mechanism and optimization techniques.
In this particular scenario it seems that the issue comes from the framework itself - when nesting two ScrollViewers (as it happens with DataBoundListBox), the inner content panel cannot display its background correctly.

Regards,
Tsvyatko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Anagh
Top achievements
Rank 2
answered on 22 Jul 2014, 07:48 PM
Thanks for the answer.
I found that the same problem appears with the Silverlight ListBox too.
Tags
DataBoundListBox
Asked by
Anagh
Top achievements
Rank 2
Answers by
Tsvyatko
Telerik team
Anagh
Top achievements
Rank 2
Share this question
or