application crashes while scrolling long list selector - silverlight

I am using a longlistselector control in my WP7 app, to show some products, the problem is that when i scroll to the last few items at the bottom , the application crashes .
Any idea why it is happening?

This is because longlistselecter was used inside a scrollviewer , i removed the scrollviewer and it worked.

I had the same problem, although it wasn't in a ScrollViewer, it was in a Grid. Removing it from the Grid resolved the issue.

Related

How to remove additional margin from last item in scrollviewer?

I used 3 days on this problem, so i ask here.
I have a listbox which contains some receipt items. when i add first couple of items everything works fine :
but as soon as an item is added to listbox which "overflow" scrollviewer, random margin suddenly appears and i cant figure out how to get rid of it:
I tried different versions of .NET framework and in 4.5 this doesnt happen, but unfortunatly i am bound to .NET 3.5
Here is a link to "sandbox" application with same behavior : link
Does anybody have any ideas?
Here is requirements:
.NET 3.5
listbox must be virtualized because it can get very large.
You have set CanContentScroll="True" on ScrollContentPresenter which means you want item by item scrolling. If you set CanContentScroll="False" you won't see any empty space at bottom. Reason being now listBox will use pixel by pixel scrolling.
With item scrolling, listbox reserve some space to make sure next item comes perfectly in viewport. Hence, you see empty space at bottom.
However, setting it to false will disable UI virtualization. So, it's a kind of trade off between empty space and virtualization.
That being said, you mentioned that it's working fine in .Net4.5 which is not the case. I tried in your sample with 4.5 also and still the same result.

Scrollbars from ultragrid disappear when dock=filled

I'm writing a windows forms application with an ultragrid.
For layout reasons I'm using the dock property. When I put this property on none (from the ultragrid) the scrollbars are displayed.
When I put this property on fill the scrollbars are gone.
Does anyone know how I can fix this?
I've found an answer on the infragistics forum.
The problem was that other controls on the form where displayed in some way over the ultragrid (allthough it didn't look like it).
The solution is to rightclick on the ultragrid in the form and then select 'bring to front' . The next time i ran the application the scrollbars where there.

z order of surface listbox item

I am trying to bring the focus on the clicked item of the surface listbox. For WPF I had a similar post and it worked after setting the trigger property of .
The full xaml code is available at http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/5d486826-9a72-4769-bd09-ff6977e16c30/#cd2cd9af-abbf-40ca-9e30-4684ee2a2eb2
I tried doing the same in the xaml code for a surface button which is put as item in surface listbox, nothing happens. Basically, my listbox contains surface buttons and when any button is clicked, it scales up i.e. the size of it increases. The only issue is that next item overlaps the scaled item because of the z-order issue. For the normal WPF listbox and button control above code did the trick but its not happening for surface application.
Would appreciate any help/directions in this issue.
Got it working.. Had posted on MSDN and it finally worked by setting the zIndex of the surfaceListbox instead of the content of the item which was a surfacebutton.
http://social.msdn.microsoft.com/Forums/en-US/surfaceappdevelopment/thread/970877bd-2960-4f0e-a203-1d357bbd55ce/#4a08e54b-5055-4a66-ad75-762ee88ef303

How to make popup grow up in silverlight?

I'm having a problem with combobox popup (not sure if it's a problem of combobox). First when i click it, dropdown popup opens correct - upwards(there are about 50 items in it, and combobox is located in the bottom of the page, if it goes downwards, there would be only 5 items visible). But then if i select any item, and them open it again - it will open downwards and put items in a scroll. So how can I fix this and force popup open in the desired direction?
Are you setting the "MaxDropDownHeight" at some point? By default it is infinity but maybe setting to hard # greater than # in combo box might help.
Also I just tested this in SL4/Firefox and the combo box pops up each time (with or without a selected item). What version of SL are you using?
Well, what I've done - I subscribed to SizeChanged event of the Border element which is a child of Popup.Child canvas. In that method, I'm calculating space below and above the combo box and then setting Top offset using Canvas.SetTop method to that border and it's MaxHeight. Maybe I will post some code later.
I was having this exact same issue (actually with Silverlight 5, but the same behavior nonetheless). I tried various things with MaxDropDownHeight but that did not correct the problem.
#Walker the approach you mentioned in your answer sounded promising but I was not able to tell from your description how you actually implemented that.
In any case, I found a rather unlikely solution. I discovered that if I populated my ComboBox with ComboBoxItems instead of a collection of custom objects, then the dropdown/selection/direction issue does not occur. I've posted an answer here that goes into a little more detail.

DataGrid vertical scrollbar problems after resizing

I'm working with a DataGrid in Silverlight.
If I have enough items so that the vertical scroll bar is visible for all sizes of the window, and I re-size the window a few times, the vertical scroll gets out of sync. The thumb gets to small as if the control thinks that there are more items then it is. When I drag the thumb towards the bottom or the top, the content starts to jump. It happens all the time, very frustrating. The DataGridis laying within a DockPanel that is re-sized according how large the window is (no specific size that is)
Anyone have any ideas?
I have some similar issues. Most of them could be resolved by calling UpdateLayout on the datagrid.
I too have a datagrid in a dockpanel. When I scroll down and select the bottom record and then reload my datagrid the horizontal scrollbar seems to cover the last record. And the vertical scrollbar appears to be as far down as possible and cannot be dragged down further.
If i use the scrollwheel on the mouse the last record can be brought into view.
This only occurs when i show my application in a maximized window.
Have you gotten anywhere with this?
I tried similar approach with the derived DataGrid.
The difference is that the OnApplyTemplate would only get the instance of VerticalScrollbar and the separate public method was introduced to invoke the UpdateLayout() on the scroll bar. Such method is to be called explicitly in the situations that may bring the scroll bar size out of sync (DataGridcontent resizing, etc.)
Sometimes the UpdateLayout() alone was not enough so I added flipping the scroll bar visibility - that worked better though still not in 100% of situations
This is a bug in the datagrid. You can solve this by inheriting from the datagrid and on the OnApplyTemplate method you search for the scrollbars and manually update their layout:
public override void OnApplyTemplate()
{
verticalScrollBar = this.GetTemplateChild("VerticalScrollbar") as ScrollBar;
if (verticalScrollBar != null)
{
verticalScrollBar.UpdateLayout();
}
}
If this still doesn't work then try calling the OnApplyTemplate method manuallty in code.
In data grid Style remove the vertical scroll bar and follow the Below Steps
Step1: Sorround the DataGridRowsPresenter with Scroll Viewer
Step2: Make HorizantalScrollBarVisibility to Disable
Step3: VerticalScrollBarVisibility to Auto

Resources